[svk-commit] r2400 - in trunk/lib/SVK: .

nobody at bestpractical.com nobody at bestpractical.com
Fri Jun 1 18:56:03 EDT 2007


Author: clkao
Date: Fri Jun  1 18:56:02 2007
New Revision: 2400

Modified:
   trunk/lib/SVK/Command.pm
   trunk/lib/SVK/Command/Diff.pm

Log:
svk diff -r:123 should report invalid -r rather than blow up.

Reported by: nelhage


Modified: trunk/lib/SVK/Command.pm
==============================================================================
--- trunk/lib/SVK/Command.pm	(original)
+++ trunk/lib/SVK/Command.pm	Fri Jun  1 18:56:02 2007
@@ -1147,6 +1147,8 @@
             die loc ("Invalid -r.\n");
         } else {
             $revspec = [map {split /:/} @$revspec];
+            # reject -r :123
+            die loc ("Invalid -r.\n") unless length $revspec->[0];
             ($r1, $r2) = map {
                 $self->resolve_revision($target,$_);
             } @$revspec;

Modified: trunk/lib/SVK/Command/Diff.pm
==============================================================================
--- trunk/lib/SVK/Command/Diff.pm	(original)
+++ trunk/lib/SVK/Command/Diff.pm	Fri Jun  1 18:56:02 2007
@@ -104,7 +104,7 @@
 	    $target2 = $target->new;
 	    $report = $target->report; # get the report before it turns to depotpath
 	    $target = $target->as_depotpath;
-	    $target = $target->seek_to($r1) if $r1;
+	    $target = $target->seek_to($r1) if defined $r1;
 	    $target2 = $target->as_depotpath->seek_to($r2) if $r2;
 	    # if no revision is specified, use the xdroot as target1's root
 	    $oldroot = $target2->create_xd_root unless $r1 || $r2;


More information about the svk-commit mailing list