lfs: use progess helper
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 18 Jun 2018 14:59:53 -0700
changeset 38411 76a08cec029d
parent 38410 398716063c2d
child 38412 65d1d7da63d1
lfs: use progess helper Differential Revision: https://phab.mercurial-scm.org/D3806
hgext/lfs/blobstore.py
--- a/hgext/lfs/blobstore.py	Mon Jun 18 14:52:41 2018 -0700
+++ b/hgext/lfs/blobstore.py	Mon Jun 18 14:59:53 2018 -0700
@@ -405,7 +405,8 @@
         if len(objects) > 1:
             self.ui.note(_('lfs: need to transfer %d objects (%s)\n')
                          % (len(objects), util.bytecount(total)))
-        self.ui.progress(topic, 0, total=total)
+        progress = self.ui.makeprogress(topic, total=total)
+        progress.update(0)
         def transfer(chunk):
             for obj in chunk:
                 objsize = obj.get('size', 0)
@@ -443,9 +444,9 @@
         for _one, oid in oids:
             processed += sizes[oid]
             blobs += 1
-            self.ui.progress(topic, processed, total=total)
+            progress.update(processed)
             self.ui.note(_('lfs: processed: %s\n') % oid)
-        self.ui.progress(topic, pos=None, total=total)
+        progress.complete()
 
         if blobs > 0:
             if action == 'upload':