[PATCH evolve-ext V3] obsdiscovery: include units in ui.progress() calls (issue5773)

Anton Shestakov av6 at dwimlabs.net
Tue Mar 13 07:07:55 UTC 2018


# HG changeset patch
# User Anton Shestakov <av6 at dwimlabs.net>
# Date 1519388837 -28800
#      Fri Feb 23 20:27:17 2018 +0800
# Node ID f30a4131c6f28f355af2c1259632399e05dfca07
# Parent  1f0c88a9dd1cdf11d9eb8db48cc5e6e70022230b
obsdiscovery: include units in ui.progress() calls (issue5773)

diff --git a/hgext3rd/evolve/obsdiscovery.py b/hgext3rd/evolve/obsdiscovery.py
--- a/hgext3rd/evolve/obsdiscovery.py
+++ b/hgext3rd/evolve/obsdiscovery.py
@@ -95,7 +95,8 @@ def findcommonobsmarkers(ui, local, remo
     common = set()
     undecided = set(probeset)
     totalnb = len(undecided)
-    ui.progress(_("comparing with other"), 0, total=totalnb)
+    ui.progress(_("comparing with other"), 0, total=totalnb,
+                unit=_("changesets"))
     _takefullsample = setdiscovery._takefullsample
     if remote.capable('_evoext_obshash_1'):
         getremotehash = remote.evoext_obshash1
@@ -114,7 +115,7 @@ def findcommonobsmarkers(ui, local, remo
 
         roundtrips += 1
         ui.progress(_("comparing with other"), totalnb - len(undecided),
-                    total=totalnb)
+                    total=totalnb, unit=_("changesets"))
         ui.debug("query %i; still undecided: %i, sample size is: %i\n"
                  % (roundtrips, len(undecided), len(sample)))
         # indices between sample and externalized version must match
@@ -175,7 +176,8 @@ def findmissingrange(ui, local, remote, 
 
     local.obsstore.rangeobshashcache.update(local)
     querycount = 0
-    ui.progress(_("comparing obsmarker with other"), querycount)
+    ui.progress(_("comparing obsmarker with other"), querycount,
+                unit=_("queries"))
     overflow = []
     while sample or overflow:
         if overflow:
@@ -230,7 +232,8 @@ def findmissingrange(ui, local, remote, 
                     addentry(new)
         assert nbsample == nbreplies
         querycount += 1
-        ui.progress(_("comparing obsmarker with other"), querycount)
+        ui.progress(_("comparing obsmarker with other"), querycount,
+                    unit=_("queries"))
     ui.progress(_("comparing obsmarker with other"), None)
     local.obsstore.rangeobshashcache.save(local)
     duration = timer() - starttime
@@ -771,7 +774,8 @@ def _obsrelsethashtree(repo, encodeonema
     cache = []
     unfi = repo.unfiltered()
     markercache = {}
-    repo.ui.progress(_("preparing locally"), 0, total=len(unfi))
+    repo.ui.progress(_("preparing locally"), 0, total=len(unfi),
+                     unit=_("changesets"))
     for i in unfi:
         ctx = unfi[i]
         entry = 0
@@ -801,7 +805,8 @@ def _obsrelsethashtree(repo, encodeonema
             cache.append((ctx.node(), sha.digest()))
         else:
             cache.append((ctx.node(), node.nullid))
-        repo.ui.progress(_("preparing locally"), i, total=len(unfi))
+        repo.ui.progress(_("preparing locally"), i, total=len(unfi),
+                         unit=_("changesets"))
     repo.ui.progress(_("preparing locally"), None)
     return cache
 


More information about the Mercurial-devel mailing list