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

nobody at bestpractical.com nobody at bestpractical.com
Mon Dec 24 03:13:07 EST 2007


Author: clsung
Date: Mon Dec 24 03:13:07 2007
New Revision: 2667

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

Log:
- use SVK::Logger

Modified: trunk/lib/SVK/Command/Branch.pm
==============================================================================
--- trunk/lib/SVK/Command/Branch.pm	(original)
+++ trunk/lib/SVK/Command/Branch.pm	Mon Dec 24 03:13:07 2007
@@ -56,6 +56,7 @@
 use SVK::I18N;
 use SVK::Util qw( is_uri get_prompt );
 use SVK::Project;
+use SVK::Logger;
 
 use constant narg => undef;
 
@@ -87,7 +88,7 @@
 
     my $proj = $self->load_project($target);
 
-    print loc("Project mapped.  Project name: %1.\n", $proj->name);
+    $logger->info( loc("Project mapped.  Project name: %1.\n", $proj->name));
 
     return;
 }
@@ -115,6 +116,7 @@
 package SVK::Command::Branch::list;
 use base qw(SVK::Command::Branch);
 use SVK::I18N;
+use SVK::Logger;
 
 sub run {
     my ($self, $target) = @_;
@@ -122,7 +124,7 @@
     my $proj = $self->load_project($target);
 
     if (!$proj) {
-	print loc("No project branch founded.\n");
+	$logger->info( loc("No project branch founded.\n"));
 	return;
     }
 
@@ -130,19 +132,19 @@
 	my $fmt = "%s%s\n"; # here to change layout
 
 	my $branches = $proj->branches (0); # branches
-	printf $fmt, $_, '' for @{$branches};
+	$logger->info (sprintf $fmt, $_, '') for @{$branches};
 	
 	$branches = $proj->tags ();         # tags
-	printf $fmt, $_, ' (tags)' for @{$branches};
+	$logger->info (sprintf $fmt, $_, ' (tags)') for @{$branches};
 
 	$branches = $proj->branches (1);    # local branches
-	printf $fmt, $_, ' (in local)' for @{$branches};
+	$logger->info (sprintf $fmt, $_, ' (in local)') for @{$branches};
 
     } else {
 	my $branches = $proj->branches ($self->{local});
 
 	my $fmt = "%s\n"; # here to change layout
-	printf $fmt, $_ for @{$branches};
+	$logger->info (sprintf $fmt, $_) for @{$branches};
     }
     return;
 }
@@ -151,6 +153,7 @@
 use base qw( SVK::Command::Copy SVK::Command::Switch SVK::Command::Branch );
 use SVK::I18N;
 use SVK::Util qw( is_uri );
+use SVK::Logger;
 
 sub lock { $_[0]->lock_target ($_[1]); };
 
@@ -195,10 +198,11 @@
     my $ret = $self->SUPER::run($src, $dst);
 
     if (!$ret) {
-	print loc("Project branch created: %1%2%3\n",
+	$logger->info( loc("Project branch created: %1%2%3\n",
 	    $branch_path,
 	    $self->{local} ? ' (in local)' : '',
 	    $self->{from} ? " (from $self->{from})" : '',
+	  )
 	);
 	# call SVK::Command::Switch here if --switch-to
 	$self->SVK::Command::Switch::run(


More information about the svk-commit mailing list