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

nobody at bestpractical.com nobody at bestpractical.com
Tue Dec 5 13:41:00 EST 2006


Author: clkao
Date: Tue Dec  5 13:41:00 2006
New Revision: 2218

Added:
   trunk/t/22status-conflict.t
Modified:
   trunk/   (props changed)
   trunk/MANIFEST
   trunk/lib/SVK/XD.pm

Log:
 r7379 at ubuntu (orig r2215):  clkao | 2006-12-05 17:25:23 +0800
 Fix a bug that "svk st X" prints stack trace when X exists and
 has conflicts.
 


Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	(original)
+++ trunk/MANIFEST	Tue Dec  5 13:41:00 2006
@@ -228,6 +228,7 @@
 t/20add.t
 t/21delete.t
 t/22status.t
+t/22status-conflict.t
 t/23commit-file.t
 t/23commit-inter-nav.t
 t/23commit-inter-output.t

Modified: trunk/lib/SVK/XD.pm
==============================================================================
--- trunk/lib/SVK/XD.pm	(original)
+++ trunk/lib/SVK/XD.pm	Tue Dec  5 13:41:00 2006
@@ -1294,7 +1294,8 @@
     }
     # don't use depth when we are still traversing through targets
     my $descend = defined $targets || !(defined $arg{depth} && $arg{depth} == 0);
-    $arg{cb_conflict}->($arg{editor}, $arg{entry}, $arg{baton})
+    # XXX: the top level entry is undefined, which should be fixed.
+    $arg{cb_conflict}->($arg{editor}, defined $arg{entry} ? $arg{entry} : '', $arg{baton})
 	if $thisdir && $arg{cb_conflict} && $cinfo->{'.conflict'};
 
     return 1 if $self->_node_deleted_or_absent (%arg, pool => $pool);

Added: trunk/t/22status-conflict.t
==============================================================================
--- (empty file)
+++ trunk/t/22status-conflict.t	Tue Dec  5 13:41:00 2006
@@ -0,0 +1,48 @@
+#!/usr/bin/perl -w
+use Test::More tests => 5;
+use strict;
+use SVK::Test;
+our $output;
+my ($xd, $svk) = build_test();
+my ($copath, $corpath) = get_copath ('status-conflict');
+
+my ($repospath, undef, $repos) = $xd->find_repos ('//', 1);
+$svk->checkout ('//', $copath);
+chdir($copath);
+mkdir('A');
+mkdir('A/deep');
+overwrite_file("A/foo", "foobar");
+
+$svk->add('A');
+$svk->ci(-m => 'orz');
+
+
+mkdir("A/something");
+
+is_output($svk, 'up', [-r => 0],
+	  ['Syncing //(/) in '.__($corpath).' to 0.',
+	   __('C   A'),
+	   __('D   A/deep'),
+	   __('D   A/foo'),
+	   __('C   A/something'),
+	   '2 conflicts found.']);
+
+is_output($svk, 'st', [],
+	  ['C   A',
+	   'C   A/something']);
+
+is_output($svk, 'up', [],
+	  ['Syncing //(/) in '.__($corpath).' to 1.',
+	   '    A - skipped']);
+
+is_output($svk, 'st', ['A'],
+	  [map {__($_) }
+	   '!   A/deep',
+	   '!   A/foo',
+	   'C   A/something',
+	   'C   A']);
+
+is_output($svk, 'st', ['A/something'],
+	  [__('C   A/something')]);
+
+


More information about the svk-commit mailing list