[svk-commit] r2616 - in branches/bm: t/bm

nobody at bestpractical.com nobody at bestpractical.com
Thu Dec 6 00:12:09 EST 2007


Author: clsung
Date: Thu Dec  6 00:11:59 2007
New Revision: 2616

Modified:
   branches/bm/lib/SVK/Command/Branch.pm
   branches/bm/t/bm/merge.t

Log:
- fix error when merged to "./"
- now use arg_copath() for dst first, if error then try arg_depotpath()
- add tests to t/bm/merge.t

Modified: branches/bm/lib/SVK/Command/Branch.pm
==============================================================================
--- branches/bm/lib/SVK/Command/Branch.pm	(original)
+++ branches/bm/lib/SVK/Command/Branch.pm	Thu Dec  6 00:11:59 2007
@@ -298,6 +298,8 @@
 
 use constant narg => 1;
 
+sub lock { $_[0]->lock_target ($_[1]) if $_[1]; };
+
 sub expand_branch {
     my ($self, $proj, $arg) = @_;
     return $arg unless $arg =~ m/\*/;
@@ -333,7 +335,12 @@
     $dst_branch_path =  '/'.$proj->depot->depotname.'/'.$proj->trunk
 	if $dst eq 'trunk';
 
-    $dst = $self->arg_depotpath($dst_branch_path);
+    # try to get checkout from copath (if dst is specified PATH)
+    # if failed (SVN::Node::none), get from depotpath
+    $dst = $self->arg_copath($dst);
+    $dst = $dst->source;
+    $dst = $self->arg_depotpath($dst_branch_path)
+        if $SVN::Node::none == $dst->root->check_path($dst->path);
 
     # see also check_only in incmrental smerge.  this should be a
     # better api in svk::path
@@ -413,6 +420,7 @@
  branch --list [BRANCH...]
  branch --create BRANCH [--local] [--switch-to]
  branch --move BRANCH1 BRANCH2
+ branch --merge BRANCH1 BRANCH2 ... TARGET
 
 =head1 OPTIONS
 

Modified: branches/bm/t/bm/merge.t
==============================================================================
--- branches/bm/t/bm/merge.t	(original)
+++ branches/bm/t/bm/merge.t	Thu Dec  6 00:11:59 2007
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 use strict;
-use Test::More tests => 14;
+use Test::More tests => 17;
 use SVK::Test;
 use File::Path;
 
@@ -112,11 +112,26 @@
      'Merge back committed as revision 17.', "Syncing $uri",
      'Retrieving log information from 17 to 17',
      'Committed revision 18 from revision 17.']);
-#$svk->smerge('-m', "blah", "//mirror/MyProject/branches/smerge/bar", "//mirror/MyProject/trunk");
-#$svk->smerge('-C',"//mirror/MyProject/branches/smerge/foo", "//mirror/MyProject/trunk");
-#warn $output;
-#is_output ($svk, 'branch', ['--merge', '-C', 'smerge/foo', 'trunk'], 
-#    ["Auto-merging (0, 16) $branch_foo to $trunk (base $trunk:12).",
-#     "Checking locally against mirror source $uri.", 'G   B/S/Q/qu',
-#     qr'New merge ticket: [\w\d-]+:/branches/smerge/foo:15']);
-#warn $output;
+
+# < clkao> cls_bsd: also br --merge foo . should work
+# < clkao> well, at least not die horribly
+$svk->branch ('--create', 'merge/foo', '--switch-to');
+append_file ('B/S/Q/qu', "\nappend CBA on local branch foo\n");
+$svk->commit ('-m', 'commit message here (r20)','');
+$svk->switch ('//mirror/MyProject/trunk');
+$svk->branch ('--merge', '-C', 'merge/foo', 'trunk');
+is_output ($svk, 'branch', ['--merge', '-C', 'merge/foo', 'trunk'],
+    ["Auto-merging (0, 20) /mirror/MyProject/branches/merge/foo to $trunk (base $trunk:18).",
+     "Checking locally against mirror source $uri.", 'U   B/S/Q/qu',
+     qr'New merge ticket: [\w\d-]+:/branches/merge/foo:19']);
+is_output ($svk, 'branch', ['--merge', '-C', 'merge/foo', '.'], 
+    ["Auto-merging (0, 20) /mirror/MyProject/branches/merge/foo to $trunk (base $trunk:18).",
+     "Checking locally against mirror source $uri.", 'U   B/S/Q/qu',
+     qr'New merge ticket: [\w\d-]+:/branches/merge/foo:19']);
+is_output ($svk, 'branch', ['--merge', 'merge/foo', '.'], 
+    ["Auto-merging (0, 20) /mirror/MyProject/branches/merge/foo to $trunk (base $trunk:18).",
+     "Merging back to mirror source $uri.", 'U   B/S/Q/qu',
+     qr'New merge ticket: [\w\d-]+:/branches/merge/foo:19',
+     'Merge back committed as revision 20.', "Syncing $uri",
+     'Retrieving log information from 20 to 20',
+     'Committed revision 21 from revision 20.']);


More information about the svk-commit mailing list