[svk-commit] r2885 - in trunk: t/bm

nobody at bestpractical.com nobody at bestpractical.com
Sat May 17 03:50:25 EDT 2008


Author: clsung
Date: Sat May 17 03:50:25 2008
New Revision: 2885

Modified:
   trunk/lib/SVK/Command/Branch.pm
   trunk/t/bm/prop-setup.t

Log:
- smartly detect project name for a given mirror path
  - ref: http://EK5A
- so saying 'n' is not required in t/bm/prop-setup.t

Modified: trunk/lib/SVK/Command/Branch.pm
==============================================================================
--- trunk/lib/SVK/Command/Branch.pm	(original)
+++ trunk/lib/SVK/Command/Branch.pm	Sat May 17 03:50:25 2008
@@ -234,7 +234,7 @@
 
     my ($target,$proj);
     my $project_name = $self->{project};
-    my $msg;
+    my $msg = '';
     eval { # always try to eval current wc
 	$target = $self->arg_co_maybe($arg[0]);
     };
@@ -770,9 +770,10 @@
 
     my $proj = $self->load_project($self->arg_depotpath('/'.$target->depot->depotname.$preceding_path));
 
+    $project_name = $proj->in_which_project($target) if $proj;
+
     my $ans = 'n';
-    if ($proj && $fromProp) {
-	$project_name = $proj->name;
+    if ($proj && $fromProp && $project_name) {
 	$logger->info( loc("Project already set in properties: %1\n", $target->depotpath));
 	$ans = lc (get_prompt(
 	    loc("Is the project '%1' match? [Y/n]", $project_name)

Modified: trunk/t/bm/prop-setup.t
==============================================================================
--- trunk/t/bm/prop-setup.t	(original)
+++ trunk/t/bm/prop-setup.t	Sat May 17 03:50:25 2008
@@ -52,7 +52,7 @@
 
 chdir("..");
 is_output ($svk, 'branch', ['--list', '//mirror/nomeans/projectB'], []);
-$answer = ['n','', '','',''];
+$answer = ['', '','',''];
 is_output_like ($svk, 'branch', ['--setup', '//mirror/nomeans/projectB'],
     qr/Project detected in specified path./);
 $answer = [''];


More information about the svk-commit mailing list