[svk-commit] r2983 - trunk/lib/SVK

nobody at bestpractical.com nobody at bestpractical.com
Wed Jul 9 23:58:34 EDT 2008


Author: clsung
Date: Wed Jul  9 23:58:33 2008
New Revision: 2983

Modified:
   trunk/lib/SVK/Command.pm

Log:
- add '0' when the desired project is not list
- printf => $logger->info()

Modified: trunk/lib/SVK/Command.pm
==============================================================================
--- trunk/lib/SVK/Command.pm	(original)
+++ trunk/lib/SVK/Command.pm	Wed Jul  9 23:58:33 2008
@@ -491,22 +491,24 @@
 		map { $_ => 1 }
 		grep { $_ =~ s/^svk:project:([^:]+):.*$/$1/ } keys %prop;
 	    my @projs = keys %projects;
-	    print loc("Avaliable projects:\n");
-	    print loc("No.   Project      Path\n");
+	    $logger->info( loc("\nAvaliable projects ('0' for not choosing any project):"));
+	    $logger->info( loc("\nNo.   Project      Path"));
 	    my $index = 0;
+	    $logger->info( sprintf ("%d)    %-12s %-12s\n", $index, "(N/A)", "/") );
 	    for my $proj (@projs) {
 		$index++;
-		$projects{$proj} = '/'.$prop{'svk:project:'.$proj.':path-trunk'};
+		$projects{$proj} = $prop{'svk:project:'.$proj.':path-trunk'};
 		$projects{$proj} =~ s{/[^/]+$}{};
-		print sprintf ("%d)    %-12s %-12s\n",
-		    $index, $proj, $projects{$proj});
+		$logger->info( sprintf ("%d)    %-12s %-12s",
+		    $index, $proj, $projects{$proj}));
 	    }
 	    my $proj_answer = lc(get_prompt(
-		loc("Which project? [No.] "),
+		loc("\nWhich project? [No.] "),
 		qr(^\d+$)
 		));
 	    $proj_answer--;
-	    $path = $project_depot_root.$projects{$projs[$proj_answer]};
+	    $path = $project_depot_root.$projects{$projs[$proj_answer]} if $proj_answer >= 0;
+	    $logger->info( );
 	}
     }
 


More information about the svk-commit mailing list