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

nobody at bestpractical.com nobody at bestpractical.com
Fri Jun 1 18:38:12 EDT 2007


Author: clkao
Date: Fri Jun  1 18:38:12 2007
New Revision: 2399

Added:
   trunk/t/mirror/commit-copy.t
Modified:
   trunk/MANIFEST
   trunk/lib/SVK/Path.pm

Log:
Fix a bug when committing to mirror with tee that requires replay,
copy information is wrong if there is any.


Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	(original)
+++ trunk/MANIFEST	Fri Jun  1 18:38:12 2007
@@ -285,6 +285,7 @@
 t/copy-escape.t
 t/copy-replace.t
 t/diff/mixed-checkout.t
+t/mirror/commit-copy.t
 t/mirror/dav-authz.t
 t/mirror/relocate.t
 t/mirror/sync-crazy-replace.t

Modified: trunk/lib/SVK/Path.pm
==============================================================================
--- trunk/lib/SVK/Path.pm	(original)
+++ trunk/lib/SVK/Path.pm	Fri Jun  1 18:38:12 2007
@@ -362,6 +362,13 @@
 	    my $proplist = $txn->proplist;
 	    $ktxn->change_prop($_ => $proplist->{$_}) for keys %$proplist;
 
+	    $keditor = SVK::Editor::CopyHandler->new
+		( _editor => $keditor,
+		  cb_copy => sub {
+		      my ( $editor, $path, $rev ) = @_;
+		      return ( $path, $rev ) if $rev == -1;
+		      return $self->as_url(1, $path, $rev);
+		  });
 	    SVN::Repos::replay2($txn->root, '/', 0, 1, $keditor, undef);
 	    $txn = $ktxn;
 	    $tee->{editors}[1]->abort_edit;

Added: trunk/t/mirror/commit-copy.t
==============================================================================
--- (empty file)
+++ trunk/t/mirror/commit-copy.t	Fri Jun  1 18:38:12 2007
@@ -0,0 +1,26 @@
+#!/usr/bin/perl -w
+use strict;
+use warnings;
+use SVK::Test;
+use Test::More tests => 1;
+our ($output, $answer);
+
+my ($xd, $svk) = build_test('test');
+$svk->mkdir (-pm => 'trunk', '//trunk');
+my $tree = create_basic_tree ($xd, '//trunk');
+
+my ($srepospath, $spath, $srepos) = $xd->find_repos ('//trunk', 1);
+my $uri = uri($srepospath);
+
+$svk->mirror('/test/private', $uri);
+$svk->sync('-a');
+
+$svk->mkdir(-m => 'blah', '//fsoapf');
+is_output($svk, 'cp', [-m => 'foo', '/test/private/trunk', '/test/private/trunk-foo'],
+	  ["Merging back to mirror source $uri.",
+	   'Merge back committed as revision 5.',
+	   "Syncing $uri",
+	   'Retrieving log information from 4 to 5',
+	   'Committed revision 5 from revision 4.',
+	   'Committed revision 6 from revision 5.']);
+


More information about the svk-commit mailing list