changeset 40840:05afb32e9380

remotefilelog: use progress helper when analyzing repos Differential Revision: https://phab.mercurial-scm.org/D5375
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 04 Dec 2018 16:02:56 -0800
parents dd1006874a5a
children ad21fbcb1ba5
files hgext/remotefilelog/__init__.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/remotefilelog/__init__.py	Tue Dec 04 15:59:47 2018 -0800
+++ b/hgext/remotefilelog/__init__.py	Tue Dec 04 16:02:56 2018 -0800
@@ -811,14 +811,14 @@
     validrepos = []
     keepkeys = set()
 
-    _analyzing = _("analyzing repositories")
-
     sharedcache = None
     filesrepacked = False
 
     count = 0
+    progress = ui.makeprogress(_("analyzing repositories"), unit="repos",
+                               total=len(repos))
     for path in repos:
-        ui.progress(_analyzing, count, unit="repos", total=len(repos))
+        progress.update(count)
         count += 1
         try:
             path = ui.expandpath(os.path.normpath(path))
@@ -868,7 +868,7 @@
             return fileserverclient.getcachekey(reponame, fname, hex(fnode))
         keepkeys = repackmod.keepset(repo, keyfn=keyfn, lastkeepkeys=keepkeys)
 
-    ui.progress(_analyzing, None)
+    progress.complete()
 
     # write list of valid repos back
     oldumask = os.umask(0o002)