[svk-commit] r2344 - in branches/2.0-releng: lib/SVK/Editor t
nobody at bestpractical.com
nobody at bestpractical.com
Wed Mar 14 21:47:29 EDT 2007
Author: clkao
Date: Wed Mar 14 21:47:28 2007
New Revision: 2344
Added:
branches/2.0-releng/t/07smerge-dir-replaced.t
Modified:
branches/2.0-releng/MANIFEST
branches/2.0-releng/lib/SVK/Editor/Merge.pm
Log:
Merge from trunk:
r2320 at trunk: clkao | 2007-03-11 20:38:41 +0000
When merging the replaced directory, do not ignore the fact
when the delete part is already conflicting.
Modified: branches/2.0-releng/MANIFEST
==============================================================================
--- branches/2.0-releng/MANIFEST (original)
+++ branches/2.0-releng/MANIFEST Wed Mar 14 21:47:28 2007
@@ -200,6 +200,7 @@
t/07smerge-copy-co.t
t/07smerge-copy.t
t/07smerge-delete.t
+t/07smerge-dir-replaced.t
t/07smerge-external.t
t/07smerge-file.t
t/07smerge-foreign.t
Modified: branches/2.0-releng/lib/SVK/Editor/Merge.pm
==============================================================================
--- branches/2.0-releng/lib/SVK/Editor/Merge.pm (original)
+++ branches/2.0-releng/lib/SVK/Editor/Merge.pm Wed Mar 14 21:47:28 2007
@@ -303,7 +303,7 @@
# modified but rm locally - tag for conflict?
my ($basepath, $fromrev) = $self->_resolve_base($path);
$basepath = $path unless defined $basepath;
- if ($self->inspector->exist($basepath, $pool) == $SVN::Node::file) {
+ if (defined $pdir && $self->inspector->exist($basepath, $pool) == $SVN::Node::file) {
$self->{info}{$path}{baseinfo} = [$basepath, $fromrev]
if defined $fromrev;
$self->{info}{$path}{open} = [$pdir, $rev];
@@ -593,7 +593,10 @@
return undef unless defined $pdir;
my $pool = pop @arg;
my $touched = $self->{notify}->node_status($path);
- undef $touched if $touched && $touched eq 'C';
+ # This comes from R (D+A) where the D has conflict
+ if ($touched && $touched eq 'C') {
+ return undef;
+ }
# Don't bother calling cb_exist (which might be expensive if the parent is
# already added.
if (!$self->{added}{$pdir} && !$touched &&
Added: branches/2.0-releng/t/07smerge-dir-replaced.t
==============================================================================
--- (empty file)
+++ branches/2.0-releng/t/07smerge-dir-replaced.t Wed Mar 14 21:47:28 2007
@@ -0,0 +1,52 @@
+#!/usr/bin/perl -w
+use Test::More tests => 2;
+use strict;
+use File::Path;
+use Cwd;
+use SVK::Test;
+
+my ($xd, $svk) = build_test();
+our $output;
+my ($copath, $corpath) = get_copath ('smerge-dir-replaced');
+$svk->mkdir ('-m', 'trunk', '//trunk');
+my $tree = create_basic_tree ($xd, '//trunk');
+
+$svk->cp(-m => 'branch', '//trunk', '//local');
+
+$svk->checkout ('//trunk', $copath);
+chdir($copath);
+$svk->mkdir("A/newlevel");
+$svk->mv("A/be", "A/newlevel");
+
+$svk->commit(-m => 'mv be into newlevel');
+is_output($svk, 'sm', [-m => 'merge down', -t => '//local'],
+ ['Auto-merging (3, 5) /trunk to /local (base /trunk:3).',
+ 'A A/newlevel',
+ 'A + A/newlevel/be',
+ 'D A/be',
+ qr'New merge ticket: .*:/trunk:5',
+ 'Committed revision 6.']);
+
+append_file('A/newlevel/be', "foobar\n");
+$svk->ci(-m => 'change stuff at trunk.');
+
+$svk->sw('//local');
+
+$svk->rm('A/newlevel');
+$svk->mv('A/Q', 'A/newlevel');
+append_file('A/newlevel/qu', "fscked\n");
+$svk->cp('//trunk/B/fe' => 'A/newlevel');
+$svk->ci(-m => 'move things around on local');
+
+is_output($svk, 'sm', [-Cf => '//local'],
+ ['Auto-merging (0, 8) /local to /trunk (base /trunk:5).',
+ ' A/newlevel/qu - skipped',
+ 'D A/Q',
+ 'C A/newlevel',
+ 'C A/newlevel/be',
+ qr'New merge ticket: .*:/local:8',
+ 'Empty merge.',
+ '2 conflicts found.']);
+
+# XXX: more tests to add deltas in the in replaced dir.
+
More information about the svk-commit
mailing list