[svk-commit] r2207 - in branches/2.0-releng: t
nobody at bestpractical.com
nobody at bestpractical.com
Fri Dec 1 06:21:08 EST 2006
Author: clkao
Date: Fri Dec 1 06:21:03 2006
New Revision: 2207
Modified:
branches/2.0-releng/lib/SVK/Root.pm
branches/2.0-releng/t/23commit-mirror.t
Log:
Only cleanup txn root in the same process if cleanup_pid is speicified.
This fixes a warning after committing to mirror from a mixed-revision
checkout.
Modified: branches/2.0-releng/lib/SVK/Root.pm
==============================================================================
--- branches/2.0-releng/lib/SVK/Root.pm (original)
+++ branches/2.0-releng/lib/SVK/Root.pm Fri Dec 1 06:21:03 2006
@@ -54,7 +54,7 @@
use base qw{ Class::Accessor::Fast };
-__PACKAGE__->mk_accessors(qw(root txn pool));
+__PACKAGE__->mk_accessors(qw(root txn pool cleanup_pid));
sub AUTOLOAD {
my $func = our $AUTOLOAD;
@@ -76,12 +76,20 @@
goto &$func;
}
+sub new {
+ my $class = shift;
+ my $self = $class->SUPER::new(@_);
+ $self->{createdby} = join(' ', (caller(2))[0..2]);
+ return $self;
+}
+
sub DESTROY {
return unless $_[0]->txn;
# if this destructor is called upon the pool cleanup which holds the
# txn also, we need to use a new pool, otherwise it segfaults for
# doing allocation in a pool that is being destroyed.
- $_[0]->txn->abort(SVN::Pool->new) if $_[0]->txn;
+ $_[0]->txn->abort( SVN::Pool->new )
+ if $_[0]->txn && ( $_[0]->cleanup_pid || $$ ) == $$;
}
# return the root and path on the given revnum, the returned path is
@@ -96,7 +104,7 @@
sub txn_root {
my ($self, $pool) = @_;
my $txn = $self->fs->begin_txn($self->revision_root_revision, $pool);
- return $self->new({ txn => $txn, root => $txn->root($pool) });
+ return $self->new({ txn => $txn, root => $txn->root($pool), cleanup_pid => $$ });
}
sub same_root {
Modified: branches/2.0-releng/t/23commit-mirror.t
==============================================================================
--- branches/2.0-releng/t/23commit-mirror.t (original)
+++ branches/2.0-releng/t/23commit-mirror.t Fri Dec 1 06:21:03 2006
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
use SVK::Test;
-plan tests => 7;
+plan tests => 8;
my ($xd, $svk) = build_test('test');
@@ -42,7 +42,16 @@
append_file ("$copath/remote/A/direct-file", "modified on A\n");
$svk->add ("$copath/remote/A/direct-file");
+$svk->up(-r6 => "$copath/local/A/be");
+is_output($svk, 'ci', [-m => 'commit from mixed-revision checkout', "$copath/remote"],
+ ['Commit into mirrored path: merging back directly.',
+ "Merging back to mirror source $uri.",
+ 'Merge back committed as revision 4.',
+ "Syncing $uri",
+ 'Retrieving log information from 4 to 4',
+ 'Committed revision 8 from revision 4.']);
+append_file ("$copath/remote/A/direct-file", "more modification on A\n");
# this ruins the mirror state
is_output ($svk, 'commit', ['--direct', '-m', 'modify A directly', "$copath/remote"],
- ['Committed revision 8.']);
+ ['Committed revision 9.']);
More information about the svk-commit
mailing list