[svk-commit] r2371 - in trunk: lib/SVK t
nobody at bestpractical.com
nobody at bestpractical.com
Wed Mar 28 07:34:35 EDT 2007
Author: clkao
Date: Wed Mar 28 07:34:34 2007
New Revision: 2371
Modified:
trunk/ (props changed)
trunk/lib/SVK/Merge.pm
trunk/t/07smerge-rename3.t
Log:
r8840 at ubuntu: clkao | 2007-03-28 10:37:16 +0100
Don't forget about rename on dst when doing smerge again with
--track-renames.
Modified: trunk/lib/SVK/Merge.pm
==============================================================================
--- trunk/lib/SVK/Merge.pm (original)
+++ trunk/lib/SVK/Merge.pm Wed Mar 28 07:34:34 2007
@@ -464,7 +464,24 @@
print "Collecting renames, this might take a while.\n";
$self->_collect_rename_for($renamed, $self->{base}, $base, 0)
unless $self->{track_rename} eq 'dst';
- $self->_collect_rename_for($renamed, $self->{dst}, $base, 1);
+
+ { # different base lookup logic for smerge
+ if ($self->{track_rename} eq 'dst') {
+ my $usrc = $self->{src}->universal;
+ my $dstkey = $self->{dst}->universal->ukey;
+ my $srcinfo = $self->merge_info_with_copy($self->{src}->new);
+
+ use Data::Dumper;
+ if ($srcinfo->{$dstkey}) {
+ $base = $srcinfo->{$dstkey}->local($self->{src}->depot);
+ }
+ else {
+ $base = $base->mclone(revision => 0);
+ }
+ }
+ $self->_collect_rename_for($renamed, $self->{dst}, $base, 1);
+ }
+
return $editor unless @$renamed;
my $rename_editor = SVK::Editor::Rename->new (editor => $editor, rename_map => $renamed);
Modified: trunk/t/07smerge-rename3.t
==============================================================================
--- trunk/t/07smerge-rename3.t (original)
+++ trunk/t/07smerge-rename3.t Wed Mar 28 07:34:34 2007
@@ -5,14 +5,13 @@
#
use Test::More tests => 11;
-use Test::Exception;
use strict;
use File::Path;
use Cwd;
use SVK::Test;
my ($xd, $svk) = build_test();
-our $output;
+our ($answer, $output);
my ($co_trunk_rpath, $co_trunk_path) = get_copath ('smerge-rename3-trunk');
my ($co_branch_rpath, $co_branch_path) = get_copath ('smerge-rename3-branch');
my ($repospath, undef, $repos) = $xd->find_repos ('//', 1);
@@ -30,7 +29,7 @@
$svk->ci(-m => "test 1");
# Make a copy
-$svk->mkdir ('-m', 'trunk', '//branches');
+$svk->mkdir ('-m', 'branches', '//branches');
$svk->cp(-m => 'newbranch', '//trunk', '//branches/newbranch');
$svk->checkout ('//branches/newbranch', $co_branch_path);
is_file_content("$co_branch_path/module/test.txt", '1');
@@ -64,7 +63,6 @@
overwrite_file('module/test.txt', '3');
$svk->ci(-m => "test 3");
-$TODO = "--track-rename doesn't pick up renames on subsequent merge";
# Merge changes w/rename from trunk to branch
is_output ($svk, 'smerge', ['//trunk', '//branches/newbranch', '--track-rename', '-m', 'merge 2'], [
@@ -80,13 +78,20 @@
$svk->update();
is_file_content('module2/test.txt', '3');
-overwrite_file('module2/test.txt', '4');
+append_file('module2/test.txt', '4');
$svk->ci(-m => "test 4");
# Merge changes w/rename from trunk to branch
# NOTE: This expected output might not be completely correct!
+
+#$answer = ['d', 's'];
+#$answer = 's'; # skip
+#$ENV{SVKRESOLVE} = 'd'; # diff
+TODO: {
+$TODO = "merging renamed change back should have proper base.";
+
is_output ($svk, 'smerge', ['//branches/newbranch', '//trunk', '--track-rename', '-m', 'merge back'], [
- 'Auto-merging (0, 9) /branches/newbranch to /trunk (base /trunk:6).',
+ 'Auto-merging (0, 10) /branches/newbranch to /trunk (base /trunk:8).',
'Collecting renames, this might take a while.',
'A + module2',
'U module2/test.txt',
@@ -94,13 +99,14 @@
"New merge ticket: $uuid:/trunk:9",
'Committed revision 9.',
]);
+}
+
+TODO: {
+todo_skip 'not working', 5;
chdir($co_trunk_path);
$svk->update();
-lives_and {
-is_file_content('module2/test.txt', '4');
-}
-
+is_file_content('module2/test.txt', '34');
# adding a new dir on trunk
@@ -139,6 +145,5 @@
chdir($co_trunk_path);
$svk->update();
-lives_and {
is_file_content('bar/test.txt', 'b');
}
More information about the svk-commit
mailing list