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

nobody at bestpractical.com nobody at bestpractical.com
Tue May 20 22:17:24 EDT 2008


Author: clsung
Date: Tue May 20 22:17:23 2008
New Revision: 2889

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

Log:
- svk br in non-wc w/o --project should die as svk st

Modified: trunk/lib/SVK/Command/Branch.pm
==============================================================================
--- trunk/lib/SVK/Command/Branch.pm	(original)
+++ trunk/lib/SVK/Command/Branch.pm	Tue May 20 22:17:23 2008
@@ -84,12 +84,13 @@
     my ($self, @arg) = @_;
     @arg = ('') if $#arg < 0;
 
-    my ($target,$proj);
+    my ($target,$proj, $msg);
     my $project_name = $self->{project};
     eval {
 	$target = $self->arg_co_maybe(pop @arg);
     };
     if ($@) { # then it means we need to find the project
+	$msg = $@;
 	my @depots =  sort keys %{ $self->{xd}{depotmap} };
 	foreach my $depot (@depots) {
 	    $depot =~ s{/}{}g;
@@ -98,6 +99,7 @@
 	    $proj = SVK::Project->create_from_prop($target, $project_name);
 	    last if ($proj) ;
 	}
+	die $msg unless $proj;
     }
 #    if ($arg[0] eq 'push') {
 #	shift @arg;

Modified: trunk/lib/SVK/Project.pm
==============================================================================
--- trunk/lib/SVK/Project.pm	(original)
+++ trunk/lib/SVK/Project.pm	Tue May 20 22:17:23 2008
@@ -133,6 +133,8 @@
     my @all_mirrors     = split "\n", $root->node_prop('/','svm:mirror') || '';
     my $prop_path = '/';
     my $proj;
+
+    return unless $pathobj->path ne '/' or $pname;
     foreach my $m_path (@all_mirrors) {
 	if ($pathobj->path eq '/') { # in non-wc path
 	    $proj = $self->_create_from_prop($pathobj, $root, $m_path, $pname);


More information about the svk-commit mailing list