Patchwork D5375: remotefilelog: use progress helper when analyzing repos

login
register
mail settings
Submitter phabricator
Date Dec. 6, 2018, 11:41 a.m.
Message ID <40af61377c398ead992f925a7276dd1f@localhost.localdomain>
Download mbox | patch
Permalink /patch/37006/
State Not Applicable
Headers show

Comments

phabricator - Dec. 6, 2018, 11:41 a.m.
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




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

Patch

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)