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

nobody at bestpractical.com nobody at bestpractical.com
Sun Mar 11 16:38:41 EDT 2007


Author: clkao
Date: Sun Mar 11 16:38:41 2007
New Revision: 2320

Added:
   trunk/t/07smerge-dir-replaced.t
Modified:
   trunk/MANIFEST
   trunk/lib/SVK/Editor/Merge.pm

Log:
When merging the replaced directory, do not ignore the fact
when the delete part is already conflicting.


Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	(original)
+++ trunk/MANIFEST	Sun Mar 11 16:38:41 2007
@@ -201,6 +201,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: trunk/lib/SVK/Editor/Merge.pm
==============================================================================
--- trunk/lib/SVK/Editor/Merge.pm	(original)
+++ trunk/lib/SVK/Editor/Merge.pm	Sun Mar 11 16:38:41 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: trunk/t/07smerge-dir-replaced.t
==============================================================================
--- (empty file)
+++ trunk/t/07smerge-dir-replaced.t	Sun Mar 11 16:38:41 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