[svk-commit] r2160 - trunk/lib/SVK
clkao at bestpractical.com
clkao at bestpractical.com
Fri Nov 17 21:10:50 EST 2006
Author: clkao
Date: Fri Nov 17 21:10:50 2006
New Revision: 2160
Modified:
trunk/lib/SVK/Command.pm
Log:
Support merge -c -rev at .
Modified: trunk/lib/SVK/Command.pm
==============================================================================
--- trunk/lib/SVK/Command.pm (original)
+++ trunk/lib/SVK/Command.pm Fri Nov 17 21:10:50 2006
@@ -1012,7 +1012,13 @@
else {
eval { $torev = $self->resolve_revision($target,$_); };
die loc("Change spec %1 not recognized.\n", $_) if($@);
- $fromrev = $torev - 1;
+ if ($torev < 0) {
+ $fromrev = -$torev;
+ $torev = $fromrev - 1;
+ }
+ else {
+ $fromrev = $torev - 1;
+ }
}
push @revlist , [$fromrev, $torev];
}
@@ -1068,12 +1074,13 @@
} elsif ($revstr =~ /\{(\d\d\d\d-\d\d-\d\d)\}/) {
my $date = $1; $date =~ s/-//g;
$rev = $self->find_date_rev($target,$date);
- } elsif ((my ($rrev) = $revstr =~ m'^(\d+)@$')) {
+ } elsif ((my ($minus, $rrev) = $revstr =~ m'^(-)?(\d+)@$')) {
if (my $m = $target->is_mirrored) {
- $rev = $m->find_local_rev ($rrev);
+ $rev = $m->find_local_rev($rrev);
}
die loc ("Can't find local revision for %1 on %2.\n", $rrev, $target->path)
unless defined $rev;
+ $rev *= $minus ? -1 : 1;
} elsif ($revstr =~ /^-\d+$/) {
$rev = $self->find_head_rev($target) + $revstr;
} elsif ($revstr =~ /\D/) {
More information about the svk-commit
mailing list