SVK
view release on metacpan or search on metacpan
lib/SVK/Editor/XD.pm view on Meta::CPAN
push @{$self->{cursignature}}, $self->{signature}->load ($copath);
$self->{cursignature}[-1]{keepold} = 1;
}
return $ret;
}
sub do_delete {
my $self = shift;
my ($path, $copath) = @_;
if ($self->{update}) {
$self->{xd}{checkout}->store
($copath,
{revision => $self->{revision},
'.deleted' => 1},
{override_descendents => 0});
return $self->SUPER::do_delete (@_)
}
$self->{get_path}($path);
$self->{xd}->do_delete( $self->{xd}->create_path_object
( copath_anchor => $copath,
path => $path,
repos => $self->{repos} ),
quiet => 1 );
}
sub close_directory {
my ($self, $path) = @_;
return unless defined $path;
# the root is just an anchor
return if $self->{target} && !length($path);
my $copath = $path;
$self->{get_copath}($copath);
if ($self->{update}) {
# XXX: handle unwritable entries and back them up after the store
$self->{xd}{checkout}->store ($copath,
{revision => $self->{revision},
'.deleted' => undef},
{override_sticky_descendents => 1});
if (@{$self->{cursignature}}) {
$self->{cursignature}[-1]->flush;
pop @{$self->{cursignature}};
}
}
}
sub change_file_prop {
my ($self, $path, $name, $value) = @_;
return unless defined $path;
$self->{props}{$path}{$name} = $value
if $self->{added}{$path};
return if $self->{check_only};
my $copath = $path;
$self->{get_copath}($copath);
$self->{exe}{$path} = $value
if $name eq 'svn:executable' && $self->{update};
$self->{get_path}($path);
$self->{xd}->do_propset(
$self->{xd}->create_path_object(
copath_anchor => $copath,
path => $path,
repos => $self->{repos}
),
quiet => 1,
propname => $name,
propvalue => $value,
adjust_only => $self->{update},
);
}
sub change_dir_prop {
my ($self, @arg) = @_;
$self->change_file_prop (@arg);
}
sub close_edit {
my ($self) = @_;
}
sub abort_edit {
my ($self) = @_;
}
# XXX: this should be splitted to prepare base and schedule entry
sub _schedule_entry {
my ($self, $copath, $editor, $copyfrom, $copyfrom_rev) = @_;
my %copy;
if (defined $copyfrom) {
# Note that the delta run through $self here is for preparing
# the base for subsequent editor calls that operates on top of
# these.
my $fs = $self->{oldroot}->fs;
my $from_root = $fs->revision_root($copyfrom_rev);
$editor->{master_editor} = SVK::Editor::Checkout->new(%$self);
if (defined $editor->{target}) {
# XXX: depot_delta can't generate single file fulltext.
my $handle = $editor->apply_textdelta($editor->{target_baton}, '');
if ($handle && $#{$handle} >= 0) {
SVN::TxDelta::send_stream($from_root->file_contents($copyfrom),
@$handle);
$editor->close_file($editor->{target_baton}, $from_root->file_md5_checksum($copyfrom));
}
}
else {
$self->{xd}->depot_delta
( oldroot => $fs->revision_root(0),
newroot => $from_root,
oldpath => ['/', ''],
newpath => $copyfrom,
editor => $editor );
}
%copy = ( scheduleanchor => $copath,
'.copyfrom' => $copyfrom,
'.copyfrom_rev' => $copyfrom_rev );
}
my (undef, $schedule) = $self->{xd}->get_entry($copath, 1);
$self->{xd}{checkout}->store
( run in 0.557 second using v1.01-cache-2.11-cpan-71847e10f99 )