[PATCH 0/4] Speed improvement in fetch/clone

Goffredo Baroncelli kreijack at alice.it
Wed Jan 18 21:52:39 GMT 2006


On Wednesday 18 January 2006 05:00, Martin Pool wrote:
> On 15 Dec 2005, Goffredo Baroncelli <kreijack at alice.it> wrote:
[...]
>  It does seem to have affected the progress bar display. (?)

The patch below should resurrect the progress bar.
Goffredo

=== modified file 'bzrlib/store/weave.py'
--- bzrlib/store/weave.py
+++ bzrlib/store/weave.py
@@ -25,6 +25,7 @@
 from cStringIO import StringIO
 import urllib

+import bzrlib
 from bzrlib.weavefile import read_weave, write_weave_v5
 from bzrlib.weave import Weave
 from bzrlib.store import TransportStore, hash_prefix
@@ -162,8 +163,14 @@
         w.add_identical(old_rev_id, new_rev_id, parent_idxs)
         self.put_weave(file_id, w, transaction)

-    def copy_multi(self, from_store, file_ids):
+    def copy_multi(self, from_store, file_ids, pb=None):
         assert isinstance(from_store, WeaveStore)
+        pb = pb and pb or bzrlib.ui.ui_factory.progress_bar()
+        count=0
         for f in file_ids:
+            count += 1
             mutter("copy weave {%s} into %s", f, self)
             self._put(f, from_store._get(f))
+            pb.update('copy', count, len(file_ids))
+        pb.clear( )
+




-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack_AT_inwind.it>
Key fingerprint = CE3C 7E01 6782 30A3 5B87  87C0 BB86 505C 6B2A CFF9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060118/45d53764/attachment.pgp 


More information about the bazaar mailing list