[svk-commit] r2108 - in branches/mirror-pipeline: . lib/SVK/Command
lib/SVK/Editor lib/SVK/Mirror/Backend lib/SVK/Path lib/SVK/Root
clkao at bestpractical.com
clkao at bestpractical.com
Sat Nov 4 16:33:09 EST 2006
Author: clkao
Date: Sat Nov 4 16:33:07 2006
New Revision: 2108
Added:
branches/mirror-pipeline/MANIFEST.SKIP
Modified:
branches/mirror-pipeline/ (props changed)
branches/mirror-pipeline/COMMITTERS
branches/mirror-pipeline/MANIFEST
branches/mirror-pipeline/Makefile.PL
branches/mirror-pipeline/README
branches/mirror-pipeline/lib/SVK/Command.pm
branches/mirror-pipeline/lib/SVK/Command/Checkout.pm
branches/mirror-pipeline/lib/SVK/Command/Commit.pm
branches/mirror-pipeline/lib/SVK/Command/Copy.pm
branches/mirror-pipeline/lib/SVK/Command/Import.pm
branches/mirror-pipeline/lib/SVK/Editor/XD.pm
branches/mirror-pipeline/lib/SVK/Merge.pm
branches/mirror-pipeline/lib/SVK/Mirror.pm
branches/mirror-pipeline/lib/SVK/Mirror/Backend/SVNRa.pm
branches/mirror-pipeline/lib/SVK/Mirror/Backend/SVNSync.pm
branches/mirror-pipeline/lib/SVK/Path/Checkout.pm
branches/mirror-pipeline/lib/SVK/Root.pm
branches/mirror-pipeline/lib/SVK/Root/Checkout.pm
branches/mirror-pipeline/lib/SVK/Version.pm
branches/mirror-pipeline/lib/SVK/XD.pm
Log:
r4206 at ubuntu (orig r2096): clkao | 2006-11-02 20:00:23 -0500
unlock after failure.
r4207 at ubuntu (orig r2097): clkao | 2006-11-02 20:00:46 -0500
perltidy and comment.
r4208 at ubuntu (orig r2098): mb | 2006-11-02 20:22:28 -0500
Require Algorithm::Diff 1.1901 or later since we use Algorithm::Diff->new
which isn't available in 1.15 or earlier.
r4209 at ubuntu (orig r2099): clkao | 2006-11-02 20:58:02 -0500
1.99_03.
r4590 at ubuntu (orig r2101): clkao | 2006-11-02 23:47:43 -0500
Update repository URL.
r4591 at ubuntu (orig r2102): clkao | 2006-11-03 00:06:25 -0500
add email for stig.
r4595 at ubuntu (orig r2103): clkao | 2006-11-03 13:01:14 -0500
Fix a bug that checkout doesn't create signature cache, spotted by DannyB++.
r4596 at ubuntu (orig r2104): clkao | 2006-11-03 14:45:30 -0500
Fix a bug that svk diff doesn't use the signature cache to check if files
are modified, spotted by DannyB++.
r4598 at ubuntu (orig r2105): clkao | 2006-11-03 16:05:17 -0500
Don't clone from D::H->get when we don't need to modify the value.
r4599 at ubuntu (orig r2106): clkao | 2006-11-03 16:54:05 -0500
get_entry could do dont_clone as well.
Modified: branches/mirror-pipeline/COMMITTERS
==============================================================================
--- branches/mirror-pipeline/COMMITTERS (original)
+++ branches/mirror-pipeline/COMMITTERS Sat Nov 4 16:33:07 2006
@@ -23,4 +23,4 @@
mndrix Michael Hendricks <michael at ndrix.org>
nnunley Norman Nunley <nnunley at gmail.com>
rbrown
- stig
+ stig Stig Brautaset <stig at brautaset.org>
Modified: branches/mirror-pipeline/MANIFEST
==============================================================================
--- branches/mirror-pipeline/MANIFEST (original)
+++ branches/mirror-pipeline/MANIFEST Sat Nov 4 16:33:07 2006
@@ -5,18 +5,6 @@
contrib/svk-completion.pl
contrib/svkopendiff
contrib/update-copyright.pl
-doc/talks/images/bowing.jpg
-doc/talks/images/hate-wall.jpg
-doc/talks/images/img33.png
-doc/talks/images/img34.png
-doc/talks/images/svk_pony.jpg
-doc/talks/images/we_hate_software.jpg
-doc/talks/images/we_love_software.jpg
-doc/talks/takahashi.css
-doc/talks/takahashi.js
-doc/talks/yapcna.2006.xul
-doc/user_stories/dconway
-doc/user_stories/simon_cozens
inc/ExtUtils/AutoInstall.pm
inc/Module/AutoInstall.pm
inc/Module/Install.pm
@@ -84,6 +72,7 @@
lib/SVK/Editor/CopyHandler.pm
lib/SVK/Editor/Delay.pm
lib/SVK/Editor/Diff.pm
+lib/SVK/Editor/Dynamic.pm
lib/SVK/Editor/InteractiveCommitter.pm
lib/SVK/Editor/InteractiveStatus.pm
lib/SVK/Editor/Merge.pm
@@ -162,6 +151,7 @@
lib/SVK/XD.pm
Makefile.PL
MANIFEST
+MANIFEST.SKIP
META.yml Module meta-data (added by MakeMaker)
pkg/win32/LICENSE.txt
pkg/win32/maketest.bat
@@ -269,6 +259,7 @@
t/74view.t
t/75hook.t
t/76ignore.t
+t/api/mirror.t
t/copy-escape.t
t/copy-replace.t
t/mirror/dav-authz.t
@@ -283,4 +274,5 @@
t/svk.gpg
utils/extract-docs
utils/extract-message-catalog
+utils/pullyu
utils/svk-ediff.el
Added: branches/mirror-pipeline/MANIFEST.SKIP
==============================================================================
--- (empty file)
+++ branches/mirror-pipeline/MANIFEST.SKIP Sat Nov 4 16:33:07 2006
@@ -0,0 +1,26 @@
+~$
+.gz$
+.bak$
+Makefile$
+MANIFEST.perl$
+\.old$
+^blib/
+^pm_to_blib
+.DS_Store
+\#
+.*.swp
+var/*
+t/*/var/*
+doc/talks/*
+doc/user_stories/*
+^\.
+/\._
+\.orig$
+\.rej$
+\.tmp$
+\.diff$
+tmon\.out$
+t/checkout/*
+t/apache*
+tmp/*
+^SVK-
Modified: branches/mirror-pipeline/Makefile.PL
==============================================================================
--- branches/mirror-pipeline/Makefile.PL (original)
+++ branches/mirror-pipeline/Makefile.PL Sat Nov 4 16:33:07 2006
@@ -15,7 +15,7 @@
requires(
# 'SVN::Core' => $required_svn,
'Algorithm::Annotate' => '0',
- 'Algorithm::Diff' => '0',
+ 'Algorithm::Diff' => '1.1901',
'YAML::Syck' => '0.60',
'Data::Hierarchy' => '0.30',
'PerlIO::via::dynamic' => '0.11',
Modified: branches/mirror-pipeline/README
==============================================================================
--- branches/mirror-pipeline/README (original)
+++ branches/mirror-pipeline/README Sat Nov 4 16:33:07 2006
@@ -3,7 +3,7 @@
The latest version could be found at
- svn://svn.clkao.org/svk/trunk
+ http://svn.bestpractical.com/svk/trunk
You need Module::Install if you are not installing from release tarballs.
Modified: branches/mirror-pipeline/lib/SVK/Command.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Command.pm (original)
+++ branches/mirror-pipeline/lib/SVK/Command.pm Sat Nov 4 16:33:07 2006
@@ -739,7 +739,7 @@
return unless @tgt;
my %roots;
for (@tgt) {
- my (undef, $coroot) = $self->{xd}{checkout}->get($_);
+ my (undef, $coroot) = $self->{xd}{checkout}->get($_, 1);
$roots{$coroot}++;
}
$self->{xd}->lock($_)
Modified: branches/mirror-pipeline/lib/SVK/Command/Checkout.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Command/Checkout.pm (original)
+++ branches/mirror-pipeline/lib/SVK/Command/Checkout.pm Sat Nov 4 16:33:07 2006
@@ -52,8 +52,7 @@
if (-e $report) {
my $copath = abs_path($report);
- my ($entry, @where) = $self->{xd}{checkout}->get($copath);
-
+ my ($entry, @where) = $self->{xd}{checkout}->get($copath, 1);
return $self->SUPER::run
( SVK::Path::Checkout->real_new
({ source => $target->mclone(revision => $entry->{revision}),
@@ -77,7 +76,7 @@
# abs_path doesn't work until the parent is created.
my $copath = abs_path ($report);
- my ($entry, @where) = $self->{xd}{checkout}->get ($copath);
+ my ($entry, @where) = $self->{xd}{checkout}->get ($copath, 1);
die loc("Overlapping checkout path is not supported (%1); use 'svk checkout --detach' to remove it first.\n", $where[0])
if exists $entry->{depotpath} && $#where > 0;
Modified: branches/mirror-pipeline/lib/SVK/Command/Commit.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Command/Commit.pm (original)
+++ branches/mirror-pipeline/lib/SVK/Command/Commit.pm Sat Nov 4 16:33:07 2006
@@ -403,12 +403,12 @@
my $fs = $target->repos->fs;
sub {
my $rev = shift;
- my ($entry, $dataroot) = $self->{xd}{checkout}->get($target->copath($target->{copath_target}));
+ my ($entry, $dataroot) = $self->{xd}{checkout}->get($target->copath($target->{copath_target}), 1);
my (undef, $coanchor) = $self->{xd}->find_repos ($entry->{depotpath});
my $oldroot = $fs->revision_root ($rev-1);
# optimize checkout map
for my $copath ($self->{xd}{checkout}->find ($dataroot, {revision => qr/.*/})) {
- my $coinfo = $self->{xd}{checkout}->get ($copath);
+ my $coinfo = $self->{xd}{checkout}->get ($copath, 1);
next if $coinfo->{'.deleted'};
my $orev = eval { $oldroot->node_created_rev (abs2rel ($copath, $dataroot => $coanchor, '/')) };
defined $orev or next;
@@ -422,7 +422,7 @@
$self->{xd}{checkout}->store ($path,
{ $self->_schedule_empty },
{override_sticky_descendents => $self->{recursive}});
- if (($action eq 'D') and $self->{xd}{checkout}->get ($path)->{revision} == $rev ) {
+ if (($action eq 'D') and $self->{xd}{checkout}->get ($path, 1)->{revision} == $rev ) {
# Fully merged, remove the special node
$self->{xd}{checkout}->store (
$path, { revision => undef, $self->_schedule_empty }
Modified: branches/mirror-pipeline/lib/SVK/Command/Copy.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Command/Copy.pm (original)
+++ branches/mirror-pipeline/lib/SVK/Command/Copy.pm Sat Nov 4 16:33:07 2006
@@ -74,7 +74,7 @@
my ($copath, $report) = ($dst->copath, $dst->report);
die loc ("Path %1 already exists.\n", $copath)
if -e $copath;
- my ($entry, $schedule) = $self->{xd}->get_entry($copath);
+ my ($entry, $schedule) = $self->{xd}->get_entry($copath, 1);
$src->normalize; $src->anchorify;
$self->ensure_parent($dst);
$dst->anchorify;
Modified: branches/mirror-pipeline/lib/SVK/Command/Import.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Command/Import.pm (original)
+++ branches/mirror-pipeline/lib/SVK/Command/Import.pm Sat Nov 4 16:33:07 2006
@@ -35,7 +35,7 @@
sub lock {
my ($self, $target, $source) = @_;
- unless ($self->{xd}{checkout}->get ($source)->{depotpath}) {
+ unless ($self->{xd}{checkout}->get ($source, 1)->{depotpath}) {
$self->{xd}->lock ($source) if $self->{to_checkout};
return;
}
@@ -79,7 +79,7 @@
}
}
- unless (exists $self->{xd}{checkout}->get ($copath)->{depotpath}) {
+ unless (exists $self->{xd}{checkout}->get ($copath, 1)->{depotpath}) {
$self->{xd}{checkout}->store
($copath, {depotpath => '/'.$target->depotname.$target->path_anchor,
'.newprop' => undef,
Modified: branches/mirror-pipeline/lib/SVK/Editor/XD.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Editor/XD.pm (original)
+++ branches/mirror-pipeline/lib/SVK/Editor/XD.pm Sat Nov 4 16:33:07 2006
@@ -134,7 +134,7 @@
# editor in the future, or to update the cache in cb_localmod
# for modified entries.
$self->{cursignature}[-1]->changed ($file)
- if $self->{added}{$path};
+ if $added;
$self->{xd}{checkout}->store ($copath, {revision => $self->{revision}}, {override_descendents => 0});
$self->{xd}->fix_permission ($copath, $self->{exe}{$path})
if exists $self->{exe}{$path};
@@ -300,7 +300,7 @@
'.copyfrom_rev' => $copyfrom_rev );
}
- my (undef, $schedule) = $self->{xd}->get_entry($copath);
+ my (undef, $schedule) = $self->{xd}->get_entry($copath, 1);
$self->{xd}{checkout}->store
($copath, { %copy, '.schedule' => $schedule eq 'delete' ? 'replace' : 'add' }, {override_descendents => 0});
}
Modified: branches/mirror-pipeline/lib/SVK/Merge.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Merge.pm (original)
+++ branches/mirror-pipeline/lib/SVK/Merge.pm Sat Nov 4 16:33:07 2006
@@ -275,7 +275,7 @@
my $pool = SVN::Pool->new_default;
my $info = $self->merge_info ($target->new);
- $target = $target->new->as_depotpath ($self->{xd}{checkout}->get ($target->copath)->{revision})
+ $target = $target->new->as_depotpath ($self->{xd}{checkout}->get ($target->copath. 1)->{revision})
if $target->isa('SVK::Path::Checkout');
$info->add_target ($target, $self->{xd}) unless $noself;
Modified: branches/mirror-pipeline/lib/SVK/Mirror.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Mirror.pm (original)
+++ branches/mirror-pipeline/lib/SVK/Mirror.pm Sat Nov 4 16:33:07 2006
@@ -189,9 +189,9 @@
my ( $self, $lock, $code ) = @_;
$self->lock;
- $code->();
+ eval { $code->() };
$self->unlock;
-
+ die $@ if $@;
}
sub _lock_token {
Modified: branches/mirror-pipeline/lib/SVK/Mirror/Backend/SVNRa.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Mirror/Backend/SVNRa.pm (original)
+++ branches/mirror-pipeline/lib/SVK/Mirror/Backend/SVNRa.pm Sat Nov 4 16:33:07 2006
@@ -228,12 +228,12 @@
my $err;
{
- local $SVN::Error::handler = sub { $err = $_[0]; die \'error handled' };
- if (eval { $ra->replay(0, 0, 0, SVK::Editor->new); 1}) {
- $self->_ra_finished($ra);
- return $self->_has_replay(1);
+ local $SVN::Error::handler = sub { $err = $_[0]; die \'error handled' };
+ if ( eval { $ra->replay( 0, 0, 0, SVK::Editor->new ); 1 } ) {
+ $self->_ra_finished($ra);
+ return $self->_has_replay(1);
+ }
}
-}
$self->_ra_finished($ra);
return $self->_has_replay(0)
if $err->apr_err == $SVN::Error::RA_NOT_IMPLEMENTED # ra_svn
@@ -559,6 +559,7 @@
$self->{commit_ra} = $self->_new_ra( url => $self->mirror->url.$path );
my @lock = $SVN::Core::VERSION ge '1.2.0' ? (undef, 0) : ();
+ # XXX: add error check for get_commit_editor here, auth error happens here
return SVN::Delta::Editor->new(
$self->{commit_ra}->get_commit_editor(
$msg,
Modified: branches/mirror-pipeline/lib/SVK/Mirror/Backend/SVNSync.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Mirror/Backend/SVNSync.pm (original)
+++ branches/mirror-pipeline/lib/SVK/Mirror/Backend/SVNSync.pm Sat Nov 4 16:33:07 2006
@@ -26,7 +26,8 @@
sub _init_state {
my ( $self, $txn, $editor ) = @_;
- die "Requires newer svn for replay support.\n" unless $self->has_replay;
+ die loc("Requires newer svn for replay support when mirroring to /.\n")
+ unless $self->has_replay;
my $mirror = $self->mirror;
die loc( "Must replicate whole repository at %1.\n", $mirror->url )
if $self->source_path;
Modified: branches/mirror-pipeline/lib/SVK/Path/Checkout.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Path/Checkout.pm (original)
+++ branches/mirror-pipeline/lib/SVK/Path/Checkout.pm Sat Nov 4 16:33:07 2006
@@ -53,7 +53,7 @@
my $self = shift;
my $copath = $self->copath($self->copath_target);
- my (undef, $coroot) = $self->xd->{checkout}->get($copath);
+ my (undef, $coroot) = $self->xd->{checkout}->get($copath, 1);
Carp::cluck $copath.YAML::Syck::Dump($self->xd->{checkout}) unless $coroot;
my @paths = $self->xd->{checkout}->find($coroot, {revision => qr'.*'});
my $tmp = $copath;
Modified: branches/mirror-pipeline/lib/SVK/Root.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Root.pm (original)
+++ branches/mirror-pipeline/lib/SVK/Root.pm Sat Nov 4 16:33:07 2006
@@ -49,4 +49,14 @@
return $self->new({ txn => $txn, root => $txn->root($pool) });
}
+sub same_root {
+ my ($self, $other) = @_;
+ return 1 if $self eq $other;
+ return unless ref($self) eq __PACKAGE__ && ref($other) eq __PACKAGE__;
+ if ($self->txn) {
+ return $other->txn ? $self->txn->name eq $other->txn->name : 0;
+ }
+ return $self->revision_root_revision == $other->revision_root_revision;
+}
+
1;
Modified: branches/mirror-pipeline/lib/SVK/Root/Checkout.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Root/Checkout.pm (original)
+++ branches/mirror-pipeline/lib/SVK/Root/Checkout.pm Sat Nov 4 16:33:07 2006
@@ -26,7 +26,7 @@
return $SVN::Node::none unless -e _;
return (is_symlink || -f _) ? $SVN::Node::file : $SVN::Node::dir
- if $self->path->xd->{checkout}->get($copath)->{'.schedule'} or
+ if $self->path->xd->{checkout}->get($copath, 1)->{'.schedule'} or
$root->check_path($path, $pool);
return $SVN::Node::unknown;
}
@@ -53,7 +53,7 @@
sub closest_copy {
my ($self, $path, $pool) = @_;
my ($copath, $root) = $self->_get_copath($path, $pool);
- my $entry = $self->path->xd->{checkout}->get($copath);
+ my $entry = $self->path->xd->{checkout}->get($copath, 1);
my $kind = $entry->{'.schedule'} || '';
return $root->closest_copy($path, $pool) unless $kind eq 'add';
@@ -64,7 +64,7 @@
sub copied_from {
my ($self, $path, $pool) = @_;
my ($copath, $root) = $self->_get_copath($path, $pool);
- my $entry = $self->path->xd->{checkout}->get($copath);
+ my $entry = $self->path->xd->{checkout}->get($copath, 1);
my $kind = $entry->{'.schedule'};
return $root->copied_from($path, $pool) unless $kind eq 'add';
@@ -75,7 +75,7 @@
sub node_history {
my ($self, $path, $pool) = @_;
my ($copath, $root) = $self->_get_copath($path, $pool);
- my $entry = $self->path->xd->{checkout}->get($copath);
+ my $entry = $self->path->xd->{checkout}->get($copath, 1);
my $kind = $entry->{'.schedule'} || '';
return $root->node_history($path, $pool) unless $kind eq 'add';
@@ -106,7 +106,7 @@
else {
# Do we know about the node?
$coentries->{$_} = SVK::Root::Checkout::Entry->new
- ({ kind => $self->path->xd->{checkout}->get($copath)->{'.schedule'} ?
+ ({ kind => $self->path->xd->{checkout}->get($copath, 1)->{'.schedule'} ?
$kind : $SVN::Node::unknown });
}
}
@@ -133,7 +133,7 @@
my $copath = abs2rel($path, $self->path->path_anchor => $self->path->copath);
my $root;
($root, $_[1]) = $self->path->source->root->get_revision_root
- ($path, $self->path->xd->{checkout}->get($copath)->{revision}, $pool);
+ ($path, $self->path->xd->{checkout}->get($copath, 1)->{revision}, $pool);
return ($copath, $root);
}
Modified: branches/mirror-pipeline/lib/SVK/Version.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/Version.pm (original)
+++ branches/mirror-pipeline/lib/SVK/Version.pm Sat Nov 4 16:33:07 2006
@@ -1,6 +1,6 @@
package SVK;
-our $VERSION = '1.99_02';
+our $VERSION = '1.99_03';
=head1 NAME
Modified: branches/mirror-pipeline/lib/SVK/XD.pm
==============================================================================
--- branches/mirror-pipeline/lib/SVK/XD.pm (original)
+++ branches/mirror-pipeline/lib/SVK/XD.pm Sat Nov 4 16:33:07 2006
@@ -287,7 +287,7 @@
sub lock {
my ($self, $path) = @_;
- if ($self->{checkout}->get ($path)->{lock}) {
+ if ($self->{checkout}->get ($path, 1)->{lock}) {
die loc("%1 already locked, use 'svk cleanup' if lock is stalled\n", $path);
}
$self->{checkout}->store ($path, {lock => $$});
@@ -489,13 +489,13 @@
$anchor = $path->clone;
$anchor->copath_anchor(Path::Class::dir($anchor->copath_anchor));
}
- my ($cinfo, $schedule) = $self->get_entry($anchor->copath_anchor);
+ my ($cinfo, $schedule) = $self->get_entry($anchor->copath_anchor, 1);
while ($cinfo->{scheduleanchor} || !-d $anchor->copath_anchor ||
$schedule eq 'add' || $schedule eq 'delete' || $schedule eq 'replace' ||
!( $anchor->copath_anchor->subsumes($path->copath_anchor)) ) {
$anchor->anchorify;
$anchor->copath_anchor(Path::Class::dir($anchor->copath_anchor));
- ($cinfo, $schedule) = $self->get_entry($anchor->copath_anchor);
+ ($cinfo, $schedule) = $self->get_entry($anchor->copath_anchor, 1);
}
push @{$anchor->source->{targets}}, abs2rel($path->copath, $anchor->copath => undef, '/') unless $anchor->path eq $path->path;
}
@@ -604,7 +604,7 @@
# In the simple case - only one revision entry found, it can be
# for some descendents. If so we actually need to construct
# txnroot.
- my ($simple, @bases) = $self->{checkout}->get($paths[0] || $copath);
+ my ($simple, @bases) = $self->{checkout}->get($paths[0] || $copath, 1);
# XXX this isn't really right: we aren't guaranteed that $revbase
# actually has the revision, it might just have a lock or
# something
@@ -615,7 +615,7 @@
my $pool = SVN::Pool->new;
for (@paths) {
- my $cinfo = $self->{checkout}->get ($_);
+ my $cinfo = $self->{checkout}->get ($_, 1);
my $path = abs2rel($_, $copath => $arg{path}, '/');
unless ($root) {
my $base_rev = $cinfo->{revision};
@@ -752,7 +752,7 @@
return if m/$ignore/;
my $cpath = catdir($File::Find::dir, $_);
no warnings 'uninitialized';
- return if $self->{checkout}->get ($cpath)->{'.schedule'}
+ return if $self->{checkout}->get($cpath, 1)->{'.schedule'}
eq 'delete';
push @deleted, $cpath;
@@ -1117,7 +1117,7 @@
}
else {
# deleted during base_root -> xdroot
- if ($arg{xdroot} ne $arg{base_root} && $arg{kind} == $SVN::Node::none) {
+ if (!$arg{base_root_is_xd} && $arg{kind} == $SVN::Node::none) {
$self->_node_deleted (%arg);
return 1;
}
@@ -1170,7 +1170,7 @@
if (!$arg{base} or $arg{in_copy}) {
$newprops = $fullprop;
}
- elsif ($arg{base_root} ne $arg{xdroot} && $arg{base}) {
+ elsif (!$arg{base_root_is_xd} && $arg{base}) {
$newprops = _prop_delta ($arg{base_root}->node_proplist ($arg{base_path}), $fullprop)
if $arg{kind} && $arg{base_kind} && _prop_changed (@arg{qw/base_root base_path xdroot path/});
}
@@ -1264,7 +1264,6 @@
sub _delta_dir {
my ($self, %arg) = @_;
- # warn "===> $arg{entry} ".join(',',(caller)[0..2]) if $ENV{SVKDEBUG};
if ($arg{entry} && $arg{exclude} && exists $arg{exclude}{$arg{entry}}) {
$arg{cb_exclude}->($arg{path}, $arg{copath}) if $arg{cb_exclude};
return;
@@ -1329,7 +1328,7 @@
if ($descend) {
my $signature;
- if ($self->{signature} && $arg{xdroot} eq $arg{base_root}) {
+ if ($self->{signature} && $arg{base_root_is_xd}) {
$signature = $self->{signature}->load ($arg{copath});
# if we are not iterating over all entries, keep the old signatures
$signature->{keepold} = 1 if defined $targets
@@ -1347,7 +1346,7 @@
my $kind = $entries->{$entry}->kind;
my $unchanged = ($kind == $SVN::Node::file && $signature && !$signature->changed ($entry));
$copath = SVK::Path::Checkout->copath ($arg{copath}, $copath);
- my ($ccinfo, $ccschedule) = $self->get_entry($copath);
+ my ($ccinfo, $ccschedule) = $self->get_entry($copath, 1);
# a replace with history node requires handling the copy anchor in the
# latter direntries loop. we should really merge the two.
if ($ccschedule eq 'replace' && $ccinfo->{'.copyfrom'}) {
@@ -1380,7 +1379,7 @@
base => !$obs,
depth => defined $arg{depth} ? defined $targets ? $arg{depth} : $arg{depth} - 1: undef,
entry => $newentry,
- kind => $arg{xdroot} eq $arg{base_root} ? $kind : $arg{xdroot}->check_path ($newpath),
+ kind => $arg{base_root_is_xd} ? $kind : $arg{xdroot}->check_path ($newpath),
base_kind => $kind,
targets => $newtarget,
baton => $baton,
@@ -1434,9 +1433,9 @@
path => $arg{path} eq '/' ? "/$entry" : "$arg{path}/$entry",
base_path => $arg{base_path} eq '/' ? "/$entry" : "$arg{base_path}/$entry",
targets => $newtarget, base_kind => $SVN::Node::none);
- $newpaths{kind} = $arg{xdroot} eq $arg{base_root} ? $SVN::Node::none :
+ $newpaths{kind} = $arg{base_root_is_xd} ? $SVN::Node::none :
$arg{xdroot}->check_path ($newpaths{path}) != $SVN::Node::none;
- my ($ccinfo, $sche) = $self->get_entry($newpaths{copath});
+ my ($ccinfo, $sche) = $self->get_entry($newpaths{copath}, 1);
my $add = $sche || $arg{auto_add} || $newpaths{kind};
# If we are not at intermediate path, process ignore
# for unknowns, as well as the case of auto_add (import)
@@ -1462,7 +1461,7 @@
my ($type, $st) = _node_type ($newpaths{copath}) or next;
my $delta = $type eq 'directory' ? \&_delta_dir : \&_delta_file;
my $copyfrom = $ccinfo->{'.copyfrom'};
- my $fromroot = $copyfrom ? $arg{repos}->fs->revision_root ($ccinfo->{'.copyfrom_rev'}) : undef;
+ my ($fromroot) = $copyfrom ? $arg{xdroot}->get_revision_root($newpaths{path}, $ccinfo->{'.copyfrom_rev'}) : undef;
$self->$delta ( %arg, %newpaths, add => 1, baton => $baton,
root => 0, base => 0, cinfo => $ccinfo,
type => $type,
@@ -1473,6 +1472,7 @@
_really_in_copy => 1,
in_copy => $arg{expand_copy},
base_kind => $fromroot->check_path ($copyfrom),
+ base_root_is_xd => 0,
base_root => $fromroot,
base_path => $copyfrom) : (),
);
@@ -1504,7 +1504,8 @@
$arg{encoder} = get_encoder;
Carp::cluck unless defined $arg{base_path};
my $kind = $arg{base_kind} = $arg{base_root}->check_path ($arg{base_path});
- $arg{kind} = $arg{base_root} eq $arg{xdroot} ? $kind : $arg{xdroot}->check_path ($arg{path});
+ $arg{base_root_is_xd} = $arg{base_root}->same_root($arg{xdroot});
+ $arg{kind} = $arg{base_root_is_xd} ? $kind : $arg{xdroot}->check_path ($arg{path});
die "checkout_delta called with non-dir node"
unless $kind == $SVN::Node::dir;
my ($copath, $repospath) = @arg{qw/copath repospath/};
@@ -1517,7 +1518,7 @@
# XXX: translate $repospath to use '/'
$arg{cb_copyfrom} ||= $arg{expand_copy} ? sub { (undef, -1) }
: sub { my $path = $_[0]; $path =~ s/%/%25/g; ("file://$repospath$path", $_[1]) };
- my ($entry) = $self->get_entry($arg{copath});
+ my ($entry) = $self->get_entry($arg{copath}, 1);
my $rev = $arg{cb_resolve_rev}->($arg{path}, $entry->{revision});
local $SIG{INT} = sub {
$arg{editor}->abort_edit;
@@ -1537,14 +1538,14 @@
=cut
sub get_entry {
- my ($self, $copath) = @_;
- my $entry = $self->{checkout}->get($copath);
+ my ($self, $copath, $dont_clone) = @_;
+ my $entry = $self->{checkout}->get($copath, $dont_clone);
return ($entry, $entry->{'.schedule'} || '');
}
sub resolved_entry {
my ($self, $entry) = @_;
- my $val = $self->{checkout}->get ($entry);
+ my $val = $self->{checkout}->get ($entry, 1);
return unless $val && $val->{'.conflict'};
$self->{checkout}->store ($entry, {%$val, '.conflict' => undef});
print loc("%1 marked as resolved.\n", $entry);
@@ -1736,7 +1737,7 @@
my ($self, $entry, $copath, $root) = @_;
return unless $entry->{scheduleanchor};
my $descendent = abs2rel($copath, $entry->{scheduleanchor}, '', '/');
- $entry = $self->{checkout}->get ($entry->{scheduleanchor})
+ $entry = $self->{checkout}->get ($entry->{scheduleanchor}, 1)
if $entry->{scheduleanchor} ne $copath;
my $from = $entry->{'.copyfrom'} or return;
$from .= $descendent;
@@ -1747,7 +1748,7 @@
sub get_props {
my ($self, $root, $path, $copath, $entry) = @_;
my $props = {};
- $entry ||= $self->{checkout}->get ($copath) if $copath;
+ $entry ||= $self->{checkout}->get ($copath, 1) if $copath;
my $schedule = $entry->{'.schedule'} || '';
if (my ($source_path, $source_root) = $self->_copy_source ($entry, $copath, $root)) {
More information about the svk-commit
mailing list