[svk-commit] r2113 - in trunk: lib/SVK/Command t

clkao at bestpractical.com clkao at bestpractical.com
Mon Nov 6 04:11:43 EST 2006


Author: clkao
Date: Mon Nov  6 04:11:43 2006
New Revision: 2113

Modified:
   trunk/   (props changed)
   trunk/lib/SVK/Command/Copy.pm
   trunk/t/12copy.t

Log:
 r7229 at ubuntu:  clkao | 2006-11-06 05:36:05 +0000
 When trying to copy across mirrors, suggests sm -IB for publish.


Modified: trunk/lib/SVK/Command/Copy.pm
==============================================================================
--- trunk/lib/SVK/Command/Copy.pm	(original)
+++ trunk/lib/SVK/Command/Copy.pm	Mon Nov  6 04:11:43 2006
@@ -151,10 +151,15 @@
     my ($self, @src) = @_;
     my $dst = pop @src;
 
-    return loc("Different depots.\n") unless $dst->same_repos (@src);
-    my $m = $self->under_mirror ($dst);
-    return loc("Different sources.\n")
-	if $m && !$dst->same_source (@src);
+    return loc("Different depots.\n") unless $dst->same_repos(@src);
+    my $m = $self->under_mirror($dst);
+    if ( $m && !$dst->same_source(@src) ) {
+        print loc("You are trying to copy across different mirrors.\n");
+        die loc( "Try create an empty directory %1, and run smerge --baseless %2 %3.\n",
+            $dst->report, $src[0]->report, $dst->report )
+          if $#src == 0 && $dst->isa('SVK::Path');
+        return 1;
+    }
     $self->check_src (@src);
     # XXX: check dst to see if the copy is obstructured or missing parent
     my $fs = $dst->repos->fs;

Modified: trunk/t/12copy.t
==============================================================================
--- trunk/t/12copy.t	(original)
+++ trunk/t/12copy.t	Mon Nov  6 04:11:43 2006
@@ -129,7 +129,8 @@
 $svk->update ($copath);
 
 is_output ($svk, 'cp', ['//V/new', '//foo-remote/new'],
-	   ['Different sources.']);
+	   ['You are trying to copy across different mirrors.',
+	    'Try create an empty directory //foo-remote/new, and run smerge --baseless //V/new //foo-remote/new.']);
 
 is_output ($svk, 'cp', ['-m', 'copy directly', '//V/me', '//V/me-dcopied'],
 	   ['Committed revision 15.']);
@@ -151,7 +152,7 @@
 $svk->checkout ('//foo-remote', $copath);
 
 is_output ($svk, 'cp', ['//V/me', "$copath/me-rcopied"],
-	   ['Different sources.']);
+	   ['You are trying to copy across different mirrors.']);
 $svk->copy ('-m', 'from co', "$copath/me", '//foo-remote/me-rcopied.again');
 is_copied_from ("//foo-remote/me-rcopied.again", '/foo-remote/me', 14);
 is_copied_from ("/foo/me-rcopied.again", '/me', 2);


More information about the svk-commit mailing list