changeset 40838:901f6ef670ca

debugbuildannotatecache: use progress helper Differential Revision: https://phab.mercurial-scm.org/D5373
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 04 Dec 2018 15:57:11 -0800
parents 64051af15596
children dd1006874a5a
files hgext/fastannotate/commands.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/fastannotate/commands.py	Fri Jul 13 11:45:15 2018 +0200
+++ b/hgext/fastannotate/commands.py	Tue Dec 04 15:57:11 2018 -0800
@@ -261,8 +261,9 @@
         repo.prefetchfastannotate(paths)
     else:
         # server, or full repo
+        progress = ui.makeprogress(_('building'), total=len(paths))
         for i, path in enumerate(paths):
-            ui.progress(_('building'), i, total=len(paths))
+            progress.update(i)
             with facontext.annotatecontext(repo, path) as actx:
                 try:
                     if actx.isuptodate(rev):
@@ -281,5 +282,4 @@
                         # cache for other files.
                         ui.warn(_('fastannotate: %s: failed to '
                                   'build cache: %r\n') % (path, ex))
-        # clear the progress bar
-        ui.write()
+        progress.complete()