[svk-commit] r2489 - in branches/2.0-releng: lib/SVK/Editor t
nobody at bestpractical.com
nobody at bestpractical.com
Tue Jul 17 11:58:51 EDT 2007
Author: clkao
Date: Tue Jul 17 11:58:50 2007
New Revision: 2489
Added:
branches/2.0-releng/t/07smerge-copy-outside.t
Modified:
branches/2.0-releng/MANIFEST
branches/2.0-releng/lib/SVK/Editor/Copy.pm
Log:
merge from trunk:
r2395 at trunk: clkao | 2007-05-17 16:38:57 +0100
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: branches/2.0-releng/MANIFEST
==============================================================================
--- branches/2.0-releng/MANIFEST (original)
+++ branches/2.0-releng/MANIFEST Tue Jul 17 11:58:50 2007
@@ -199,6 +199,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: branches/2.0-releng/lib/SVK/Editor/Copy.pm
==============================================================================
--- branches/2.0-releng/lib/SVK/Editor/Copy.pm (original)
+++ branches/2.0-releng/lib/SVK/Editor/Copy.pm Tue Jul 17 11:58:50 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: branches/2.0-releng/t/07smerge-copy-outside.t
==============================================================================
--- (empty file)
+++ branches/2.0-releng/t/07smerge-copy-outside.t Tue Jul 17 11:58:50 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