remotefilelog: use progress helper when analyzing repos
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 04 Dec 2018 16:02:56 -0800
changeset 40840 05afb32e9380
parent 40839 dd1006874a5a
child 40841 ad21fbcb1ba5
remotefilelog: use progress helper when analyzing repos Differential Revision: https://phab.mercurial-scm.org/D5375
hgext/remotefilelog/__init__.py
--- 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)