Patchwork D5380: remotefilelog: use progress helper in shallowrepo

login
register
mail settings
Submitter phabricator
Date Dec. 6, 2018, 11:41 a.m.
Message ID <ae034f74a2cba4a2038372f0c8a3d861@localhost.localdomain>
Download mbox | patch
Permalink /patch/37010/
State Not Applicable
Headers show

Comments

phabricator - Dec. 6, 2018, 11:41 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb6a6dc1a14bd: remotefilelog: use progress helper in shallowrepo (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5380?vs=12719&id=12741

REVISION DETAIL
  https://phab.mercurial-scm.org/D5380

AFFECTED FILES
  hgext/remotefilelog/shallowrepo.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/remotefilelog/shallowrepo.py b/hgext/remotefilelog/shallowrepo.py
--- a/hgext/remotefilelog/shallowrepo.py
+++ b/hgext/remotefilelog/shallowrepo.py
@@ -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: