[svk-commit] r2133 - in trunk: lib/SVK/Mirror/Backend t

clkao at bestpractical.com clkao at bestpractical.com
Fri Nov 10 15:07:42 EST 2006


Author: clkao
Date: Fri Nov 10 15:07:36 2006
New Revision: 2133

Added:
   trunk/t/23commit-subdir.t
Modified:
   trunk/MANIFEST
   trunk/lib/SVK/Mirror/Backend/SVNRa.pm

Log:
Do not recycle ra from get_commit_editor which are not based on
mirror anchor.


Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	(original)
+++ trunk/MANIFEST	Fri Nov 10 15:07:36 2006
@@ -229,6 +229,7 @@
 t/23commit-inter-output.t
 t/23commit-mirror.t
 t/23commit-multi.t
+t/23commit-subdir.t
 t/23commit.t
 t/24diff.t
 t/25log-filter.t

Modified: trunk/lib/SVK/Mirror/Backend/SVNRa.pm
==============================================================================
--- trunk/lib/SVK/Mirror/Backend/SVNRa.pm	(original)
+++ trunk/lib/SVK/Mirror/Backend/SVNRa.pm	Fri Nov 10 15:07:36 2006
@@ -484,7 +484,9 @@
         $self->{commit_ra}->get_commit_editor(
             $msg,
             sub {
-		$self->_ra_finished($self->{commit_ra});
+		# only recycle the ra if we are committing from root
+		$self->_ra_finished($self->{commit_ra})
+		    unless length $path;
                 $committed->(@_);
             },
             @lock ) );

Added: trunk/t/23commit-subdir.t
==============================================================================
--- (empty file)
+++ trunk/t/23commit-subdir.t	Fri Nov 10 15:07:36 2006
@@ -0,0 +1,39 @@
+#!/usr/bin/perl -w
+use strict;
+use SVK::Test;
+plan tests => 2;
+
+my ($xd, $svk) = build_test('test');
+
+my $tree = create_basic_tree ($xd, '/test/');
+my ($srepospath, $spath, $srepos) = $xd->find_repos ('/test/', 1);
+
+my $uri = uri($srepospath);
+
+$svk->mirror ('//remote', $uri);
+$svk->sync ('//remote');
+my ($copath, $corpath) = get_copath ('commit-subdir');
+
+
+$svk->checkout ('//remote', $copath);
+append_file ("$copath/A/be", "modified on A\n");
+
+is_output ($svk, 'status', [$copath],
+	   [__"M   $copath/A/be"]);
+
+$svk->mkdir(-m => 'hi', '/test/B/injected');
+$svk->mkdir(-m => 'hi', '/test/B/injected2');
+$svk->mkdir(-m => 'hi', '/test/B/injected3');
+$svk->mkdir(-m => 'hi', '/test/B/injected5');
+
+chdir("$copath/A");
+
+is_output ($svk, 'commit', ['-m', 'modify A'],
+	   [map qr'.*',(1..4),
+	    'Retrieving log information from 3 to 7',
+	    'Committed revision 4 from revision 3.',
+	    'Committed revision 5 from revision 4.',
+	    'Committed revision 6 from revision 5.',
+	    'Committed revision 7 from revision 6.',
+	    'Committed revision 8 from revision 7.']);
+


More information about the svk-commit mailing list