# HG changeset patch
# User Anton Shestakov <a...@dwimlabs.net>
# Date 1519388837 -28800
#      Fri Feb 23 20:27:17 2018 +0800
# Node ID 7ce1b90dbc7d6bce36398f0fab6f6db708beee0c
# 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=_("obsmarkers"))
     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=_("obsmarkers"))
     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
 
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to