[svk-commit] r2681 - in branches/mirror-boostrap/lib/SVK: Mirror/Backend

nobody at bestpractical.com nobody at bestpractical.com
Tue Jan 15 12:29:53 EST 2008


Author: clkao
Date: Tue Jan 15 12:29:52 2008
New Revision: 2681

Modified:
   branches/mirror-boostrap/lib/SVK/Mirror.pm
   branches/mirror-boostrap/lib/SVK/Mirror/Backend/SVNRa.pm

Log:
progress bar for sync.

Modified: branches/mirror-boostrap/lib/SVK/Mirror.pm
==============================================================================
--- branches/mirror-boostrap/lib/SVK/Mirror.pm	(original)
+++ branches/mirror-boostrap/lib/SVK/Mirror.pm	Tue Jan 15 12:29:52 2008
@@ -457,10 +457,13 @@
 
     $logger->info(loc("Syncing %1", $self->url).($self->_backend->_relayed ? loc(" via %1", $self->server_url) : ""));
 
+    $self->{use_progress} = 1 unless SVK::Test->can('is_output');
+
     $self->mirror_changesets($torev,
         sub {
             my ( $changeset, $rev ) = @_;
-            $logger->info("Committed revision $rev from revision $changeset.");
+            $logger->info("Committed revision $rev from revision $changeset.")
+                unless $self->{use_progress};
         }, $fake_last
     );
     die $@ if $@;

Modified: branches/mirror-boostrap/lib/SVK/Mirror/Backend/SVNRa.pm
==============================================================================
--- branches/mirror-boostrap/lib/SVK/Mirror/Backend/SVNRa.pm	(original)
+++ branches/mirror-boostrap/lib/SVK/Mirror/Backend/SVNRa.pm	Tue Jan 15 12:29:52 2008
@@ -616,7 +616,12 @@
         }
         $ra = SVK::Mirror::Backend::SVNRaPipe->new( $ra, sub { shift @gen } );
     }
+    my $progress =
+      $self->mirror->{use_progress}
+      ? SVK::Notify->new->progress( { count => scalar @revs } )
+      : undef;
     my $pool = SVN::Pool->new_default;
+    my $i = 0;
     for (@revs) {
         $pool->clear;
         my ( $changeset, $metadata ) = @$_;
@@ -630,6 +635,7 @@
         }
         $self->sync_changeset( $changeset, $metadata, $ra, $extra_prop,
             $callback );
+        $progress->update( ++$i ) if $progress;
     }
     $self->_ra_finished($ra);
 }


More information about the svk-commit mailing list