[svk-commit] r2337 - in branches/2.0-releng: lib/SVK t

nobody at bestpractical.com nobody at bestpractical.com
Wed Mar 14 20:28:08 EDT 2007


Author: clkao
Date: Wed Mar 14 20:28:07 2007
New Revision: 2337

Added:
   branches/2.0-releng/t/07smerge-tags.t
Modified:
   branches/2.0-releng/MANIFEST
   branches/2.0-releng/lib/SVK/Merge.pm
   branches/2.0-releng/t/07smerge-anchor-replace.t
   branches/2.0-releng/t/07smerge-branch-renamed.t
   branches/2.0-releng/t/07smerge-copy.t
   branches/2.0-releng/t/07smerge-mixanchor.t
   branches/2.0-releng/t/07smerge-multi.t

Log:
Merge from trunk:
 r2310 at trunk:  mb | 2007-03-06 04:25:27 +0000
 Added TODO test for repeated smerges from tags of trunk to a branch.

 r2311 at trunk:  mb | 2007-03-06 04:37:10 +0000
 Prevent unwanted repeated merges when repeatedly merging tags to a branch.
 We now also record the copy source(s) of the path being merged from in the
 merge ticket.

 r2319 at trunk:  mb | 2007-03-09 01:08:03 +0000
 Fixed so that the test succeeds 100% of the time instead of 50% of the
 time.  It was failing because, although merge tickets are sorted,
 repository uuids are random and therefore merge tickets from one
 repository would randomly end up either before of after the ones from
 the other repository.

 r2335 at trunk:  clkao | 2007-03-15 00:23:06 +0000
 add t/07smerge-tags.t to MANIFEST.


Modified: branches/2.0-releng/MANIFEST
==============================================================================
--- branches/2.0-releng/MANIFEST	(original)
+++ branches/2.0-releng/MANIFEST	Wed Mar 14 20:28:07 2007
@@ -211,6 +211,7 @@
 t/07smerge-relayed.t
 t/07smerge-rename.t
 t/07smerge-rename-dest.t
+t/07smerge-tags.t
 t/07smerge-to-from.t
 t/07smerge-tree.t
 t/07smerge-upload.t

Modified: branches/2.0-releng/lib/SVK/Merge.pm
==============================================================================
--- branches/2.0-releng/lib/SVK/Merge.pm	(original)
+++ branches/2.0-releng/lib/SVK/Merge.pm	Wed Mar 14 20:28:07 2007
@@ -533,7 +533,7 @@
 			    }
 			},
 	    ticket => 
-	    sub { $self->get_new_ticket ($self->merge_info ($src)->add_target ($src)) }
+	    sub { $self->get_new_ticket ($self->merge_info_with_copy ($src)->add_target ($src)) }
 	  ) :
 	  ( prop_resolver => { 'svk:merge' => sub { ('G', undef, 1)} # skip
 			     }),

Modified: branches/2.0-releng/t/07smerge-anchor-replace.t
==============================================================================
--- branches/2.0-releng/t/07smerge-anchor-replace.t	(original)
+++ branches/2.0-releng/t/07smerge-anchor-replace.t	Wed Mar 14 20:28:07 2007
@@ -34,4 +34,5 @@
 	   ['Auto-merging (6, 8) /trunk to /local (base /trunk:6).',
 	    'U   B/fe',
 	    'U   newfile',
-	    "New merge ticket: $uuid:/trunk:8"]);
+	    "New merge ticket: $uuid:/trunk:8",
+	    "New merge ticket: $uuid:/trunk-foo:4"]);

Modified: branches/2.0-releng/t/07smerge-branch-renamed.t
==============================================================================
--- branches/2.0-releng/t/07smerge-branch-renamed.t	(original)
+++ branches/2.0-releng/t/07smerge-branch-renamed.t	Wed Mar 14 20:28:07 2007
@@ -19,5 +19,6 @@
 	  ['Auto-merging (0, 6) /local-foo to /trunk (base /trunk:3).',
 	   '===> Auto-merging (0, 6) /local-foo to /trunk (base /trunk:3).',
 	   'A   somedir',
+	   qr'New merge ticket: .*:/local:5',
 	   qr'New merge ticket: .*:/local-foo:6',
 	   'Committed revision 7.']);

Modified: branches/2.0-releng/t/07smerge-copy.t
==============================================================================
--- branches/2.0-releng/t/07smerge-copy.t	(original)
+++ branches/2.0-releng/t/07smerge-copy.t	Wed Mar 14 20:28:07 2007
@@ -213,6 +213,7 @@
 	   'A   D/new-in-local',
 	   'D   D/de',
 	   qr'New merge ticket: .*:/local-many:40',
+	   qr'New merge ticket: .*:/trunk:3',
 	   'Committed revision 41.']);
 
 is_output($svk, 'diff', ['-sr40:41', '//'],
@@ -230,6 +231,7 @@
 	   'U   B/de',
 	   'U   b-s/de',
 	   'A + b-s-cp',
+	   qr'New merge ticket: .*:/trunk:3',
 	   qr'New merge ticket: .*:/trunk-3:42',
 	   'Committed revision 43.']);
 

Modified: branches/2.0-releng/t/07smerge-mixanchor.t
==============================================================================
--- branches/2.0-releng/t/07smerge-mixanchor.t	(original)
+++ branches/2.0-releng/t/07smerge-mixanchor.t	Wed Mar 14 20:28:07 2007
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 use SVK::Test;
-plan tests => 3;
+plan tests => 4;
 
 our $output;
 # build another tree to be mirrored ourself
@@ -20,6 +20,7 @@
 my ($srepospath, $spath, $srepos) = $xd->find_repos ('/test/', 1);
 my ($repospath, undef, $repos) = $xd->find_repos ('//', 1);
 my $uuid = $repos->fs->get_uuid;
+my $suuid = $srepos->fs->get_uuid;
 my $uri = uri($srepospath);
 
 $svk->mirror ('//mirror', $uri.($spath eq '/' ? '' : $spath));
@@ -45,15 +46,22 @@
 	    'Retrieving log information from 8 to 8',
 	    'Committed revision 15 from revision 8.']);
 
-is_output ($svk, 'pg', ['svk:merge', '//local/3.3-TESTING', '//mirror/3.3-TESTING'],
-	   ["//local/3.3-TESTING - $uuid:/3.3-exp:11",
-	    "//mirror/3.3-TESTING - $uuid:/3.3-exp:11"]);
+is_sorted_output ($svk, 'pg', ['svk:merge', '//local/3.3-TESTING'],
+	   ["$uuid:/3.3-exp:11",
+	    "$suuid:/3.3-TESTING:7",
+	    "$suuid:/trunk:3"]);
+
+is_sorted_output ($svk, 'pg', ['svk:merge', '//mirror/3.3-TESTING'],
+	   ["$uuid:/3.3-exp:11",
+	    "$suuid:/3.3-TESTING:7",
+	    "$suuid:/trunk:3"]);
 
 is_output ($svk, 'smerge', ['-m', 'merge back 3.3-another to remote directly', '//3.3-another', '//mirror/3.3-TESTING'],
 	   ['Auto-merging (0, 13) /3.3-another to /mirror/3.3-TESTING (base /3.3-exp:11).',
 	    "Merging back to mirror source $uri.",
 	    'A   local-3.3-only/yay',
 	    "New merge ticket: $uuid:/3.3-another:13",
+	    "New merge ticket: $uuid:/local/3.3-TESTING:9",
 	    'Merge back committed as revision 9.',
 	    "Syncing $uri",
 	    'Retrieving log information from 9 to 9',

Modified: branches/2.0-releng/t/07smerge-multi.t
==============================================================================
--- branches/2.0-releng/t/07smerge-multi.t	(original)
+++ branches/2.0-releng/t/07smerge-multi.t	Wed Mar 14 20:28:07 2007
@@ -69,7 +69,7 @@
 
 system {$^X} ($^X, "-pi.bak", "-e", "s|#!/usr/bin/|#!env |", "$copath/trunk/test.pl");
 
-$svk->commit ('-m', 'mod on trunk before branch to featre', "$copath/trunk");
+$svk->commit ('-m', 'mod on trunk before branch to feature', "$copath/trunk");
 
 $svk->copy ('-m', 'branch //feature', '//trunk', '//feature');
 $svk->update ($copath);
@@ -89,7 +89,7 @@
 is_output_like ($svk, 'smerge', ['-m', 'merge from //feature', '//feature', '//work'],
 		qr|base /trunk:9|);
 is_output_like ($svk, 'smerge', ['-m', 'merge from //work to //trunk', '//work', '//trunk'],
-		qr|base /trunk:9|);
+		qr|base /trunk:11|);
 is_output_like ($svk, 'smerge', ['-m', 'merge from //trunk to //feature', '//trunk', '//feature'],
 	        qr|base /feature:14|);
 

Added: branches/2.0-releng/t/07smerge-tags.t
==============================================================================
--- (empty file)
+++ branches/2.0-releng/t/07smerge-tags.t	Wed Mar 14 20:28:07 2007
@@ -0,0 +1,61 @@
+#!/usr/bin/perl -w
+use Test::More tests => 3;
+use strict;
+use File::Path;
+use Cwd;
+use SVK::Test;
+
+my ($xd, $svk) = build_test();
+our $output;
+my ($copath, $corpath) = get_copath ('smerge-copy');
+$svk->mkdir ('-m', 'trunk', '//trunk');
+$svk->cp ('-m', 'branch', '//trunk', '//branch');
+my $tree = create_basic_tree ($xd, '//trunk');
+$svk->cp ('-m', 'tag1', '//trunk', '//tag1');
+
+is_output($svk, 'sm', ['-m', 'merge tag1 to branch', '//tag1', '//branch'],
+	  ['Auto-merging (0, 5) /tag1 to /branch (base /trunk:1).',
+	   'A   A',
+	   'A   A/Q',
+	   'A   A/Q/qu',
+	   'A   A/Q/qz',
+	   'A   A/be',
+	   'A   B',
+	   'A   B/S',
+	   'A   B/S/P',
+	   'A   B/S/P/pe',
+	   'A   B/S/Q',
+	   'A   B/S/Q/qu',
+	   'A   B/S/Q/qz',
+	   'A   B/S/be',
+	   'A   B/fe',
+	   'A   me',
+	   'A   C',
+	   'A   C/R',
+	   'A   D',
+	   'A   D/de',
+	   qr'New merge ticket: .*:/tag1:5',
+	   qr'New merge ticket: .*:/trunk:4',
+	   'Committed revision 6.'
+	  ]);
+
+$svk->checkout ('//trunk', $copath);
+chdir($copath);
+
+overwrite_file('new-in-trunk', 'new file on trunk');
+$svk->add('new-in-trunk');
+$svk->ci(-m => 'new file');
+
+$svk->cp ('-m', 'tag2', '//trunk', '//tag2');
+
+is_output($svk, 'sm', ['-m', 'merge tag2 to branch', '//tag2', '//branch'],
+	  ['Auto-merging (0, 8) /tag2 to /branch (base /trunk:4).',
+	   'A   new-in-trunk',
+	   qr'New merge ticket: .*:/tag2:8',
+	   qr'New merge ticket: .*:/trunk:7',
+	   'Committed revision 9.'
+	  ]);
+
+is_output($svk, 'sm', ['-m', 'merge trunk to branch', '//trunk', '//branch'],
+	  ['Auto-merging (7, 7) /trunk to /branch (base /trunk:7).',
+	   'Empty merge.']);


More information about the svk-commit mailing list