Patchwork D3806: lfs: use progess helper

login
register
mail settings
Submitter phabricator
Date June 19, 2018, 12:45 a.m.
Message ID <differential-rev-PHID-DREV-xx5hff2gfjbgawinzu4e-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/32312/
State Superseded
Headers show

Comments

phabricator - June 19, 2018, 12:45 a.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3806

AFFECTED FILES
  hgext/lfs/blobstore.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/lfs/blobstore.py b/hgext/lfs/blobstore.py
--- a/hgext/lfs/blobstore.py
+++ b/hgext/lfs/blobstore.py
@@ -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':