D5375: remotefilelog: use progress helper when analyzing repos

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Dec 6 06:41:10 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG05afb32e9380: remotefilelog: use progress helper when analyzing repos (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5375?vs=12714&id=12737

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

AFFECTED FILES
  hgext/remotefilelog/__init__.py

CHANGE DETAILS

diff --git a/hgext/remotefilelog/__init__.py b/hgext/remotefilelog/__init__.py
--- a/hgext/remotefilelog/__init__.py
+++ b/hgext/remotefilelog/__init__.py
@@ -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)



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


More information about the Mercurial-devel mailing list