[svk-commit] r2796 - in trunk: lib/SVK lib/SVK/Command t
nobody at bestpractical.com
nobody at bestpractical.com
Tue May 6 04:35:22 EDT 2008
Author: clkao
Date: Tue May 6 04:35:19 2008
New Revision: 2796
Modified:
trunk/ (props changed)
trunk/lib/SVK/Command/Commit.pm
trunk/lib/SVK/Util.pm
trunk/t/23commit.t
Log:
r21103 at caladan: sartak | 2007-06-28 12:00:36 -0400
Another checkout of svk
r21110 at caladan: sartak | 2007-06-28 12:36:10 -0400
Make ?->A support work by using absolute paths
r21116 at caladan: sartak | 2007-06-28 14:05:27 -0400
Fix case where you're using "svk ci .." or similar, and more tests
Modified: trunk/lib/SVK/Command/Commit.pm
==============================================================================
--- trunk/lib/SVK/Command/Commit.pm (original)
+++ trunk/lib/SVK/Command/Commit.pm Tue May 6 04:35:19 2008
@@ -388,6 +388,7 @@
cb_conflict => sub { shift->conflict(@_) },
cb_unknown => sub {
my ($self, $path) = @_;
+ $path = $target->copath($path);
push @unversioned, "? $path\n";
},
);
@@ -464,7 +465,7 @@
$self->decode_commit_message;
- my @need_to_add = map {$target->copath($_->[1])}
+ my @need_to_add = map {$_->[1]}
grep {$_->[0] eq 'A'}
@$targets;
for (@need_to_add)
Modified: trunk/lib/SVK/Util.pm
==============================================================================
--- trunk/lib/SVK/Util.pm (original)
+++ trunk/lib/SVK/Util.pm Tue May 6 04:35:19 2008
@@ -329,7 +329,7 @@
}
grep {
!/^\?/m
- } # remove unversioned fils
+ } # remove unversioned files
grep {/\S/}
split( /\n+/, $ret[1] );
Modified: trunk/t/23commit.t
==============================================================================
--- trunk/t/23commit.t (original)
+++ trunk/t/23commit.t Tue May 6 04:35:19 2008
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
use SVK::Test;
-plan tests => 69;
+plan tests => 74;
our $output;
my ($xd, $svk) = build_test();
@@ -333,6 +333,40 @@
is_output ($svk, 'status', [],
[__('M A/foo'),
__('M A/verbose')]);
+
+$svk->revert('A/verbose');
+
+# bug with ?->A in `svk ci ..`
+$svk->remove('A/verbose');
+
+is_output ($svk, 'status', [],
+ [__('M A/foo'),
+ __('D A/verbose')]);
+
+$svk->commit ('-m', 'blah');
+
+overwrite_file("A/foo", "hi");
+
+is_output ($svk, 'status', [],
+ [__('M A/foo')]);
+
+overwrite_file("A/verbose", "happy happy joy joy");
+
+chdir('A/deep');
+is_output ($svk, 'commit', ['..'],
+ ['Waiting for editor...',
+ 'Committed revision 20.'], 'we got a commit by replacing a ? with an A');
+chdir('../..');
+
+is_output ($svk, 'status', [],
+ [__('M A/foo')]);
+
+overwrite_file("A/verbose", "just making sure I'm versioned");
+
+is_output ($svk, 'status', [],
+ [__('M A/foo'),
+ __('M A/verbose')]);
+
$svk->revert('A/verbose');
# }}}
@@ -369,7 +403,7 @@
append_file ("A/bar", "foobar2");
is_output ($svk, 'commit', [],
['Waiting for editor...',
- 'Committed revision 21.'], 'buffer unmodified');
+ 'Committed revision 23.'], 'buffer unmodified');
$answer = 'a';
append_file ("A/bar", "foobar2");
is_output ($svk, 'commit', [],
@@ -382,20 +416,20 @@
["Can't use -F with -m."]);
is_output ($svk, 'commit', [-F => 'svk-commit'],
- ['Committed revision 22.'], 'commit with -F');
+ ['Committed revision 24.'], 'commit with -F');
-is_output_like ($svk, 'log', [-r => 22],
+is_output_like ($svk, 'log', [-r => 24],
qr/my log message/);
append_file ("A/bar", "please be changed");
is_output($svk, 'commit', [-m => "i like a monkey\nand a birdie", '--template'],
["Waiting for editor...",
- "Committed revision 23."], 'commit with -m and --template');
+ "Committed revision 25."], 'commit with -m and --template');
-is_output_like ($svk, 'log', [-r => 23],
+is_output_like ($svk, 'log', [-r => 25],
qr/i like a gorilla/, 'first line successfully edited from template');
-is_output_like ($svk, 'log', [-r => 23],
+is_output_like ($svk, 'log', [-r => 25],
qr/and a parrot/, 'second line successfully edited from template');
append_file ("A/bar", "changed some more");
@@ -403,23 +437,23 @@
is_output($svk, 'commit', [-F => 'svk-commit', '--template'],
["Waiting for editor...",
- "Committed revision 24."], 'commit with -F and --template');
+ "Committed revision 26."], 'commit with -F and --template');
-is_output_like ($svk, 'log', [-r => 24],
+is_output_like ($svk, 'log', [-r => 26],
qr/this time it's a parrot/, 'first line successfully edited from template');
-is_output_like ($svk, 'log', [-r => 24],
+is_output_like ($svk, 'log', [-r => 26],
qr/also a gorilla/, 'second line successfully edited from template');
overwrite_file("changeme", 'to be committed with revprop');
$svk->add("changeme");
is_output($svk, 'commit', [-m => 'with revprop', '--set-revprop', 'fnord=baz'],
- ["Committed revision 25."], 'fnord');
+ ["Committed revision 27."], 'fnord');
is_output(
- $svk, 'pl', ['-r' => 25, '--revprop'],
- ['Unversioned properties on revision 25:',
+ $svk, 'pl', ['-r' => 27, '--revprop'],
+ ['Unversioned properties on revision 27:',
' fnord',
' svn:author',
' svn:date',
More information about the svk-commit
mailing list