[svk-commit] r2600 - in branches/bm: lib/SVK t/smerge
nobody at bestpractical.com
nobody at bestpractical.com
Mon Nov 12 14:29:25 EST 2007
Author: clkao
Date: Mon Nov 12 14:29:24 2007
New Revision: 2600
Added:
branches/bm/t/smerge/
branches/bm/t/smerge/copy-reuse.t
Modified:
branches/bm/ (props changed)
branches/bm/lib/SVK/Merge.pm
Log:
- Merge //mirror/svk/branches/bm-smerge-fixes to //mirror/svk/branches/bm
Modified: branches/bm/lib/SVK/Merge.pm
==============================================================================
--- branches/bm/lib/SVK/Merge.pm (original)
+++ branches/bm/lib/SVK/Merge.pm Mon Nov 12 14:29:24 2007
@@ -600,8 +600,18 @@
my $usrc = $src->universal;
my $srckey = join(':', $usrc->{uuid}, $usrc->{path});
if ($dstinfo->{$srckey}) {
+ # find which rev on src is merged from the base.
$boundry_rev = $src->merged_from
($self->{base}, $self, $self->{base}{path});
+ # however if src is removed and later copied again
+ # from base, we need the later one as boundry
+ my $t = $src;
+ while (my ($toroot, $fromroot, $path) = $t->nearest_copy) {
+ if ($path eq $self->{base}->path_anchor) {
+ $boundry_rev = List::Util::max( $boundry_rev, $toroot->revision_root_revision );
+ }
+ $t = $t->mclone( path => $path, revision => $fromroot->revision_root_revision );
+ }
}
else {
# when did the branch first got created?
Added: branches/bm/t/smerge/copy-reuse.t
==============================================================================
--- (empty file)
+++ branches/bm/t/smerge/copy-reuse.t Mon Nov 12 14:29:24 2007
@@ -0,0 +1,47 @@
+#!/usr/bin/perl -w
+use Test::More tests => 2;
+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');
+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->mkdir (-m => 'something bzz', '//local/blah/A/bzz');
+
+is_output($svk, 'sm', [-m => 'local to trunk', '//local/blah', '//foo/bar/trunk'],
+ ['Auto-merging (0, 7) /local/blah to /foo/bar/trunk (base /foo/bar/trunk:5).',
+ "Merging back to mirror source $uri.",
+ 'A A/bzz',
+ qr'New merge ticket: .*:/local/blah:7',
+ 'Merge back committed as revision 4.',
+ qr'Syncing .*',
+ 'Retrieving log information from 4 to 4',
+ 'Committed revision 8 from revision 4.']);
+$svk->rm( -m => 'bye', '//local/blah');
+$svk->cp( -m => 'again', '//foo/bar/trunk' => '//local/blah');
+
+$svk->mkdir (-m => 'something bzz', '//local/blah/A/bzz2');
+
+is_output($svk, 'sm', [-m => 'local to trunk', '//local/blah', '//foo/bar/trunk'],
+ ['Auto-merging (0, 11) /local/blah to /foo/bar/trunk (base /foo/bar/trunk:8).',
+ "Merging back to mirror source $uri.",
+ 'A A/bzz2',
+ qr'New merge ticket: .*:/local/blah:11',
+ 'Merge back committed as revision 5.',
+ qr'Syncing .*',
+ 'Retrieving log information from 5 to 5',
+ 'Committed revision 12 from revision 5.']);
More information about the svk-commit
mailing list