[svk-commit] r2395 - in trunk: lib/SVK/Editor t

nobody at bestpractical.com nobody at bestpractical.com
Thu May 17 11:39:27 EDT 2007


Author: clkao
Date: Thu May 17 11:39:26 2007
New Revision: 2395

Added:
   trunk/t/07smerge-copy-outside.t
Modified:
   trunk/MANIFEST
   trunk/lib/SVK/Editor/Copy.pm

Log:
Fix a bug where copies outside the mirror source across merge are not
expanded as non-copies.

Reported by: Sven Oostenbrink <sven at asca.com.mx>


Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	(original)
+++ trunk/MANIFEST	Thu May 17 11:39:26 2007
@@ -201,6 +201,7 @@
 t/07smerge-branch-renamed.t
 t/07smerge-copy-co.t
 t/07smerge-copy.t
+t/07smerge-copy-outside.t
 t/07smerge-copy2.t
 t/07smerge-cpdelete.t
 t/07smerge-delete.t

Modified: trunk/lib/SVK/Editor/Copy.pm
==============================================================================
--- trunk/lib/SVK/Editor/Copy.pm	(original)
+++ trunk/lib/SVK/Editor/Copy.pm	Thu May 17 11:39:26 2007
@@ -165,9 +165,10 @@
 	}
 	return unless $base_rev;
 
-	{ # if the copy source is out side of our branch
+	{ # if the copy source is out side of our branch, and is in the same source
 	my $hate_path = $self->{src}->path_anchor;
-	if ($src_frompath !~ m{^\Q$hate_path/}) {
+	if ($src_frompath !~ m{^\Q$hate_path/} &&
+	    $self->{dst}->same_source($self->{dst}->mclone( path_anchor => $src_frompath))) {
 	    if (my ($frompath, $from) = $self->{cb_resolve_copy}->($path, $replace, $src_frompath, $src_from)) {
 		push @{$self->{incopy}}, { path => $path,
 					   fromrev => $from,

Added: trunk/t/07smerge-copy-outside.t
==============================================================================
--- (empty file)
+++ trunk/t/07smerge-copy-outside.t	Thu May 17 11:39:26 2007
@@ -0,0 +1,43 @@
+#!/usr/bin/perl -w
+use Test::More tests => 1;
+use strict;
+use File::Path;
+use Cwd;
+use SVK::Test;
+
+my ($xd, $svk) = build_test('test');
+our $output;
+my ($copath, $corpath) = get_copath ('smerge-copy');
+$svk->mkdir ('-pm', 'trunk', '/test/trunk');
+$svk->mkdir ('-pm', 'some other local', '//local/something/fnord');
+my $tree = create_basic_tree ($xd, '/test/trunk');
+$svk->mkdir(-m => 'blah', '//foo/bar');
+
+my ($srepospath, $spath, $srepos) = $xd->find_repos ('/test/trunk', 1);
+
+my $uri = uri($srepospath).$spath;
+$svk->mi('//foo/bar/trunk', $uri);
+$svk->sync('//foo/bar/trunk');
+$svk->cp ('-m', 'branch', '//foo/bar/trunk', '//local/blah');
+$svk->cp (-m => 'something', '//local/something/fnord' => '//local/blah/fnord');
+
+is_output(
+    $svk, 'push',
+    ['//local/blah'],
+    [   'Auto-merging (0, 7) /local/blah to /foo/bar/trunk (base /foo/bar/trunk:5).',
+        '===> Auto-merging (0, 6) /local/blah to /foo/bar/trunk (base /foo/bar/trunk:5).',
+        "Merging back to mirror source $uri.",
+        'Empty merge.',
+        '===> Auto-merging (6, 7) /local/blah to /foo/bar/trunk (base /foo/bar/trunk:5).',
+        "Merging back to mirror source $uri.",
+        'A   fnord',
+        qr'New merge ticket: .*:/local/blah:7',
+        'Merge back committed as revision 4.',
+        "Syncing $uri",
+        'Retrieving log information from 4 to 4',
+        'Committed revision 8 from revision 4.',
+    ],
+    'fnord is not merged as a copy'
+);
+
+


More information about the svk-commit mailing list