RTx-Foundry
view release on metacpan or search on metacpan
sbin/foundry-lib/VCP/Dest/svn.pm view on Meta::CPAN
or die "$! linking '$source_fn' -> '$work_path'" ;
my $now = time;
utime $now, $now, $work_path
or die "$! changing times on $work_path"
=cut
}
}
if (@to_rm) {
$self->svn_rm (@to_rm);
}
=comment
if (@to_rm) {
$self->svn(['up', ($revs->[0]->branch_id ?
"branches/".$revs->[0]->branch_id :
'trunk')]);
for (@to_rm) {
my $work_path = $self->work_path($_);
unlink $work_path;
if (my @pruned = $self->prunedir($work_path)) {
@to_rm = grep { substr($_, 0, length($pruned[-1])) ne $pruned[-1] } @to_rm;
push @to_rm, $pruned[-1];
}
}
$self->svn(['rm', @to_rm]);
}
$self->svn(['add', @to_add]) if @to_add;
$self->svn(['commit', '--encoding', $self->{SVN_ENCODING}, '-m', $comment,
($revs->[0]->branch_id ?
"branches/".$revs->[0]->branch_id :
'trunk')], undef, \$output);
push @svnrev, _svn_commit_revid($output);
=cut
$self->head_revs->set([$_->source_repo_id, $_->source_filebranch_id],
$_->source_rev_id) for @$revs;
}
$self->{SVN_EDITOR}->close_edit($self->{SVN_POOL});
undef $self->{SVN_PATHS};
return;
if (@svnrev) {
my $time = iso8601format($revs->[0]->time);
$time =~ s/\s/T/;
$time =~ s/Z/\.00000Z/;
my $latest = 0;
for (@svnrev) {
$self->svn(['propset', 'svn:date', '--revprop', '-r', $_, $time]);
$self->svn(['propset', 'svn:author', '--revprop', '-r', $_, $revs->[0]->user_id]);
$latest = $_ if $latest < $_;
}
$self->rev_map->set([$_->source_repo_id, $_->id], $latest)
for @$revs;
}
else {
# we can't do force commit from svn commandline
# so just set revmap to its previous
for (@$revs) {
$self->rev_map->set([$_->source_repo_id, $_->id],
$self->rev_map->get([$_->source_repo_id, $_->previous_id]))
if $_->previous_id && $self->rev_map->exists([$_->source_repo_id, $_->previous_id]);
}
}
}
sub checkout_file {
my VCP::Dest::svn $self = shift;
my ( $r ) = @_ ;
# supposedly it only makes sense for comparing the head with the
# base_rev, otherwise even if it matches, the subsequent commit
# would cause conflict.
$self->svn(['update', $r->name]);
my $work_path = $self->work_path( $r->name ) ;
die "no file after backfill" unless -e $work_path;
return $work_path;
}
sub handle_header {
my VCP::Dest::svn $self = shift ;
$self->rev_root( $self->header->{rev_root} )
unless defined $self->rev_root ;
$self->create_svn_workspace(
create_in_repository => 1,
) ;
$self->{SVN_PENDING} = [];
$self->{SVN_PREV_CHANGE_ID} = undef;
$self->SUPER::handle_header( @_ ) ;
}
sub handle_rev {
my VCP::Dest::svn $self = shift ;
my ( $r ) = @_;
my $work_path = $self->work_path( $r->name ) ;
my $change_id = $r->change_id;
if (@{$self->{SVN_PENDING}} && $change_id ne $self->{SVN_PREV_CHANGE_ID}) {
debug "commit for ".$self->{SVN_PENDING}[0]->as_string if debugging;
$self->commit;
$self->{SVN_PENDING} = [];
( run in 0.970 second using v1.01-cache-2.11-cpan-71847e10f99 )