changeset 40845:b6a6dc1a14bd

remotefilelog: use progress helper in shallowrepo Differential Revision: https://phab.mercurial-scm.org/D5380
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 04 Dec 2018 16:32:59 -0800
parents 4e08bbfc6d51
children e58cd7ede1c3
files hgext/remotefilelog/shallowrepo.py
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/remotefilelog/shallowrepo.py	Tue Dec 04 16:31:04 2018 -0800
+++ b/hgext/remotefilelog/shallowrepo.py	Tue Dec 04 16:32:59 2018 -0800
@@ -40,8 +40,6 @@
     from mercurial.utils import procutil
     _hgexecutable = procutil.hgexecutable
 
-_prefetching = _('prefetching')
-
 # These make*stores functions are global so that other extensions can replace
 # them.
 def makelocalstores(repo):
@@ -233,9 +231,9 @@
             serverfiles = skip.copy()
             visited = set()
             visited.add(nullrev)
-            revnum = 0
             revcount = len(revs)
-            self.ui.progress(_prefetching, revnum, total=revcount)
+            progress = self.ui.makeprogress(_('prefetching'), total=revcount)
+            progress.update(0)
             for rev in sorted(revs):
                 ctx = repo[rev]
                 if pats:
@@ -264,12 +262,11 @@
                     files.update(diff)
 
                 visited.add(mfrev)
-                revnum += 1
-                self.ui.progress(_prefetching, revnum, total=revcount)
+                progress.increment()
 
             files.difference_update(skip)
             serverfiles.difference_update(skip)
-            self.ui.progress(_prefetching, None)
+            progress.complete()
 
             # Fetch files known to be on the server
             if serverfiles: