Patchwork D3801: treediscovery: use progress helper

login
register
mail settings
Submitter phabricator
Date June 18, 2018, 8:26 p.m.
Message ID <71b3bf27c37fa8bb62afe1a3f8c5b178@localhost.localdomain>
Download mbox | patch
Permalink /patch/32305/
State Not Applicable
Headers show

Comments

phabricator - June 18, 2018, 8:26 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2f5c622fcb73: treediscovery: use progress helper (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3801?vs=9195&id=9203

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

AFFECTED FILES
  mercurial/treediscovery.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/treediscovery.py b/mercurial/treediscovery.py
--- a/mercurial/treediscovery.py
+++ b/mercurial/treediscovery.py
@@ -61,6 +61,7 @@ 
 
     req = set(unknown)
     reqcnt = 0
+    progress = repo.ui.makeprogress(_('searching'), unit=_('queries'))
 
     # search through remote branches
     # a 'branch' here is a linear segment of history, with four parts:
@@ -107,7 +108,7 @@ 
 
         if r:
             reqcnt += 1
-            repo.ui.progress(_('searching'), reqcnt, unit=_('queries'))
+            progress.increment()
             repo.ui.debug("request %d: %s\n" %
                         (reqcnt, " ".join(map(short, r))))
             for p in xrange(0, len(r), 10):
@@ -125,7 +126,7 @@ 
     while search:
         newsearch = []
         reqcnt += 1
-        repo.ui.progress(_('searching'), reqcnt, unit=_('queries'))
+        progress.increment()
 
         with remote.commandexecutor() as e:
             between = e.callcommand('between', {'pairs': search}).result()
@@ -166,7 +167,7 @@ 
     repo.ui.debug("found new changesets starting at " +
                  " ".join([short(f) for f in fetch]) + "\n")
 
-    repo.ui.progress(_('searching'), None)
+    progress.complete()
     repo.ui.debug("%d total queries\n" % reqcnt)
 
     return base, list(fetch), heads