[Bps-public-commit] Prophet branch, master, updated. 2716cc28b6d6be4b846abe792cb590178ea5b03c

jesse jesse at bestpractical.com
Fri Apr 17 03:12:49 EDT 2009


The branch, master has been updated
       via  2716cc28b6d6be4b846abe792cb590178ea5b03c (commit)
      from  116cc80beb996dac8a3e388c441da8346281e1a1 (commit)

Summary of changes:
 lib/Prophet/CLI/Command/Merge.pm |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

- Log -----------------------------------------------------------------
commit 2716cc28b6d6be4b846abe792cb590178ea5b03c
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Fri Apr 17 15:12:34 2009 +0800

    fix progress bar on merge

diff --git a/lib/Prophet/CLI/Command/Merge.pm b/lib/Prophet/CLI/Command/Merge.pm
index eb9e229..4c93cad 100644
--- a/lib/Prophet/CLI/Command/Merge.pm
+++ b/lib/Prophet/CLI/Command/Merge.pm
@@ -38,20 +38,22 @@ sub run {
     my $changesets = $self->_do_merge();
 
     Prophet::CLI->start_pager();
-    $self->print_report($changesets);
+    $self->print_report($changesets) 
 }
 
 sub print_report {
-    my $self = shift;
+    my $self       = shift;
     my $changesets = shift;
-    if ($changesets == 0) {
-        print "No new changesets.\n";
-    }
-    elsif ($changesets == 1) {
-        print "Merged one changeset.\n";
-    }
-    else {
-        print "Merged $changesets changesets.\n";
+    if ( $self->has_arg('verbose') ) {
+        if ( $changesets == 0 ) {
+            print "No new changesets.\n";
+        } elsif ( $changesets == 1 ) {
+            print "Merged one changeset.\n";
+        } else {
+            print "Merged $changesets changesets.\n";
+        }
+    } else {
+        print "Done.\n";
     }
 }
 
@@ -103,7 +105,7 @@ sub _do_merge {
             $changesets++;
         };
     } else {
-        $import_args{reporting_callback} = sub { $changesets++; $self->progress_bar( max => ($source_latest - $source_last_seen), format => "%30b %p %E\r" );}
+        $import_args{reporting_callback} = $self->progress_bar( max => ($source_latest - $source_last_seen), format => "%30b %p %E\r" )
     }
 
     $self->target->import_changesets( %import_args);

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list