# HG changeset patch # User Anton Shestakov # Date 1519388837 -28800 # Node ID b738bfbef3a0f12eb4ce1fd94ec6c05a491d3050 # Parent 1f0c88a9dd1cdf11d9eb8db48cc5e6e70022230b obsdiscovery: include units in ui.progress() calls (issue5773) diff -r 1f0c88a9dd1c -r b738bfbef3a0 hgext3rd/evolve/obsdiscovery.py --- a/hgext3rd/evolve/obsdiscovery.py Sun Mar 04 20:19:19 2018 -0500 +++ b/hgext3rd/evolve/obsdiscovery.py Fri Feb 23 20:27:17 2018 +0800 @@ -95,7 +95,8 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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