remotefilelog: use progress helper in shallowbundle
Differential Revision: https://phab.mercurial-scm.org/D5379
--- a/hgext/remotefilelog/shallowbundle.py Tue Dec 04 16:29:05 2018 -0800
+++ b/hgext/remotefilelog/shallowbundle.py Tue Dec 04 16:31:04 2018 -0800
@@ -171,7 +171,6 @@
if not shallowutil.isenabled(repo):
return orig(repo, source, revmap, trp, expectedfiles, *args)
- files = 0
newfiles = 0
visited = set()
revisiondatas = {}
@@ -184,14 +183,14 @@
# files in topological order.
# read all the file chunks but don't add them
+ progress = repo.ui.makeprogress(_('files'), total=expectedfiles)
while True:
chunkdata = source.filelogheader()
if not chunkdata:
break
- files += 1
f = chunkdata["filename"]
repo.ui.debug("adding %s revisions\n" % f)
- repo.ui.progress(_('files'), files, total=expectedfiles)
+ progress.increment()
if not repo.shallowmatch(f):
fl = repo.file(f)
@@ -289,6 +288,6 @@
processed.add((f, node))
skipcount = 0
- repo.ui.progress(_('files'), None)
+ progress.complete()
return len(revisiondatas), newfiles