hgext3rd/evolve/obsdiscovery.py
changeset 4341 d1aab9d82f5b
parent 4324 e913546b9d79
child 4349 01f4ee6779d5
--- a/hgext3rd/evolve/obsdiscovery.py	Fri Jan 11 09:26:41 2019 -0800
+++ b/hgext3rd/evolve/obsdiscovery.py	Mon Jan 14 09:14:38 2019 -0800
@@ -95,8 +95,8 @@
     common = set()
     undecided = set(probeset)
     totalnb = len(undecided)
-    ui.progress(_("comparing with other"), 0, total=totalnb,
-                unit=_("changesets"))
+    compat.progress(ui, _("comparing with other"), 0, total=totalnb,
+                    unit=_("changesets"))
     _takefullsample = setdiscovery._takefullsample
     if remote.capable('_evoext_obshash_1'):
         getremotehash = remote.evoext_obshash1
@@ -120,8 +120,8 @@
                 sample = _takefullsample(dag, undecided, size=fullsamplesize)
 
         roundtrips += 1
-        ui.progress(_("comparing with other"), totalnb - len(undecided),
-                    total=totalnb, unit=_("changesets"))
+        compat.progress(ui, _("comparing with other"), totalnb - len(undecided),
+                        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
@@ -140,7 +140,7 @@
         undecided.difference_update(missing)
         undecided.difference_update(common)
 
-    ui.progress(_("comparing with other"), None)
+    compat.progress(ui, _("comparing with other"), None)
     result = dag.headsetofconnecteds(common)
     ui.debug("%d total queries\n" % roundtrips)
 
@@ -182,8 +182,8 @@
 
     local.obsstore.rangeobshashcache.update(local)
     querycount = 0
-    ui.progress(_("comparing obsmarker with other"), querycount,
-                unit=_("queries"))
+    compat.progress(ui, _("comparing obsmarker with other"), querycount,
+                    unit=_("queries"))
     overflow = []
     while sample or overflow:
         if overflow:
@@ -238,9 +238,9 @@
                     addentry(new)
         assert nbsample == nbreplies
         querycount += 1
-        ui.progress(_("comparing obsmarker with other"), querycount,
-                    unit=_("queries"))
-    ui.progress(_("comparing obsmarker with other"), None)
+        compat.progress(ui, _("comparing obsmarker with other"), querycount,
+                        unit=_("queries"))
+    compat.progress(ui, _("comparing obsmarker with other"), None)
     local.obsstore.rangeobshashcache.save(local)
     duration = util.timer() - starttime
     logmsg = ('obsdiscovery, %d/%d mismatch'
@@ -545,8 +545,8 @@
         total = len(revs)
 
         def progress(pos, rev):
-            repo.ui.progress('updating obshashrange cache',
-                             pos, 'rev %s' % rev, unit='revision', total=total)
+            compat.progress(repo.ui, 'updating obshashrange cache',
+                            pos, 'rev %s' % rev, unit='revision', total=total)
         # warm the cache for the new revs
         progress(0, '')
         for idx, r in enumerate(revs):
@@ -861,8 +861,8 @@
     cache = []
     unfi = repo.unfiltered()
     markercache = {}
-    repo.ui.progress(_("preparing locally"), 0, total=len(unfi),
-                     unit=_("changesets"))
+    compat.progress(repo.ui, _("preparing locally"), 0, total=len(unfi),
+                    unit=_("changesets"))
     for i in unfi:
         ctx = unfi[i]
         entry = 0
@@ -892,9 +892,9 @@
             cache.append((ctx.node(), sha.digest()))
         else:
             cache.append((ctx.node(), node.nullid))
-        repo.ui.progress(_("preparing locally"), i, total=len(unfi),
-                         unit=_("changesets"))
-    repo.ui.progress(_("preparing locally"), None)
+        compat.progress(repo.ui, _("preparing locally"), i, total=len(unfi),
+                        unit=_("changesets"))
+    compat.progress(repo.ui, _("preparing locally"), None)
     return cache
 
 def _obshash(repo, nodes, version=0):