Patchwork D3776: debugbuilddag: use progress helper

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

Comments

phabricator - June 18, 2018, 2:24 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGfce1c17493db: debugbuilddag: use progress helper (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3776?vs=9147&id=9180

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

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -183,6 +183,8 @@ 
     tags = []
 
     wlock = lock = tr = None
+    progress = ui.makeprogress(_('building'), unit=_('revisions'),
+                               total=total)
     try:
         wlock = repo.wlock()
         lock = repo.lock()
@@ -192,7 +194,7 @@ 
         atbranch = 'default'
         nodeids = []
         id = 0
-        ui.progress(_('building'), id, unit=_('revisions'), total=total)
+        progress.update(id)
         for type, data in dagparser.parsedag(text):
             if type == 'n':
                 ui.note(('node %s\n' % pycompat.bytestr(data)))
@@ -265,13 +267,13 @@ 
             elif type == 'a':
                 ui.note(('branch %s\n' % data))
                 atbranch = data
-            ui.progress(_('building'), id, unit=_('revisions'), total=total)
+            progress.update(id)
         tr.close()
 
         if tags:
             repo.vfs.write("localtags", "".join(tags))
     finally:
-        ui.progress(_('building'), None)
+        progress.complete()
         release(tr, lock, wlock)
 
 def _debugchangegroup(ui, gen, all=None, indent=0, **opts):