Patchwork D3848: fix: add progress bar for number of file revisions processed

login
register
mail settings
Submitter phabricator
Date June 27, 2018, 1:08 a.m.
Message ID <differential-rev-PHID-DREV-lwomcykyjbj5utmlqcre-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/32455/
State Superseded
Headers show

Comments

phabricator - June 27, 2018, 1:08 a.m.
hooper created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This ensures responsiveness when the configured tools are slow or numerous.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -162,7 +162,10 @@ 
         filedata = collections.defaultdict(dict)
         replacements = {}
         commitorder = sorted(revstofix, reverse=True)
+        progress = ui.makeprogress(topic=_('fixing'), unit=_('files'),
+                                   total=sum(numitems.values()))
         for rev, path, newdata in results:
+            progress.increment(item=path)
             if newdata is not None:
                 filedata[rev][path] = newdata
             numitems[rev] -= 1
@@ -178,6 +181,7 @@ 
                 else:
                     replacerev(ui, repo, ctx, filedata[rev], replacements)
                 del filedata[rev]
+        progress.complete()
 
         replacements = {prec: [succ] for prec, succ in replacements.iteritems()}
         scmutil.cleanupnodes(repo, replacements, 'fix', fixphase=True)