Patchwork D3795: repair: use progress helper

login
register
mail settings
Submitter phabricator
Date June 18, 2018, 8:26 p.m.
Message ID <f5ea19a4d3a0bd20bfa92cc8ff37b259@localhost.localdomain>
Download mbox | patch
Permalink /patch/32301/
State Not Applicable
Headers show

Comments

phabricator - June 18, 2018, 8:26 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf0b0c853f598: repair: use progress helper (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3795?vs=9189&id=9197

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

AFFECTED FILES
  mercurial/repair.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -355,10 +355,10 @@ 
         newentries = set()
         seenfiles = set()
 
-        repolen = len(repo)
+        progress = ui.makeprogress(_('rebuilding'), unit=_('changesets'),
+                                   total=len(repo))
         for rev in repo:
-            ui.progress(_('rebuilding'), rev, total=repolen,
-                        unit=_('changesets'))
+            progress.update(rev)
 
             ctx = repo[rev]
             for f in ctx.files():
@@ -375,7 +375,7 @@ 
                 if repo.store._exists(d):
                     newentries.add(d)
 
-        ui.progress(_('rebuilding'), None)
+        progress.complete()
 
         if 'treemanifest' in repo.requirements: # safe but unnecessary otherwise
             for dir in util.dirs(seenfiles):