[svk-commit] r3082 - trunk/lib/SVK/Command

nobody at bestpractical.com nobody at bestpractical.com
Mon Sep 8 23:21:48 EDT 2008


Author: clsung
Date: Mon Sep  8 23:21:48 2008
New Revision: 3082

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

Log:
- fix bug if 'svk br' or 'svk br --create blah' in non-checkout/non-project path

Modified: trunk/lib/SVK/Command/Branch.pm
==============================================================================
--- trunk/lib/SVK/Command/Branch.pm	(original)
+++ trunk/lib/SVK/Command/Branch.pm	Mon Sep  8 23:21:48 2008
@@ -103,7 +103,7 @@
 
     if ($proj) {
         $proj->info($target, 1);
-    } else {
+    } elsif ($target) {
 	# XXX: here just a shorthand if one calls svk br help
 	if ('help' eq file($target->path)->basename) {
 	    select STDERR unless $self->{output};
@@ -165,6 +165,7 @@
 	$msg = $@;
 	my @depots =  sort keys %{ $self->{xd}{depotmap} };
 	foreach my $depot (@depots) {
+            last unless $project_name;
 	    $depot =~ s{/}{}g;
 	    $target = eval { $self->arg_depotpath("/$depot/") };
 	    next if ($@);
@@ -293,9 +294,9 @@
     # always try to eval current wc
     my ($proj,$target, $msg) = $self->locate_project($arg[0]);
     if (!$proj) {
-	$logger->warn( "I can't figure out what project you'd like to create a branch in. Please");
-	$logger->warn("either run '$0 branch --create' from within an existing checkout or specify");
-	$logger->warn("a project root using the --project flag");
+	die loc("I can't figure out what project you'd like to create a branch in. Please\n").
+	    loc("either run '$0 branch --create' from within an existing checkout or specify\n").
+	    loc("a project root using the --project flag\n");
     }
     return ($proj, $target, $dst);
 }


More information about the svk-commit mailing list