# HG changeset patch # User Martin von Zweigbergk # Date 2018-06-18 06:06:20 # Node ID daa08d45740f778e1383184b7d56b900df8831aa # Parent 1a2ff11e8a884688732ad7ad785bb1c50b9d40e3 changegroup: use progress helper Differential Revision: https://phab.mercurial-scm.org/D3783 diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -975,12 +975,13 @@ def makestream(repo, outgoing, version, def _addchangegroupfiles(repo, source, revmap, trp, expectedfiles, needfiles): revisions = 0 files = 0 + progress = repo.ui.makeprogress(_('files'), unit=_('files'), + total=expectedfiles) for chunkdata in iter(source.filelogheader, {}): files += 1 f = chunkdata["filename"] repo.ui.debug("adding %s revisions\n" % f) - repo.ui.progress(_('files'), files, unit=_('files'), - total=expectedfiles) + progress.increment() fl = repo.file(f) o = len(fl) try: @@ -1001,7 +1002,7 @@ def _addchangegroupfiles(repo, source, r _("received spurious file revlog entry")) if not needs: del needfiles[f] - repo.ui.progress(_('files'), None) + progress.complete() for f, needs in needfiles.iteritems(): fl = repo.file(f)