Patchwork D3783: changegroup: use progress helper

login
register
mail settings
Submitter phabricator
Date June 18, 2018, 2:24 p.m.
Message ID <434c81193c2f9be64623b8ae01003fd7@localhost.localdomain>
Download mbox | patch
Permalink /patch/32290/
State Not Applicable
Headers show

Comments

phabricator - June 18, 2018, 2:24 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGdaa08d45740f: changegroup: use progress helper (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3783?vs=9154&id=9187

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

AFFECTED FILES
  mercurial/changegroup.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -975,12 +975,13 @@ 
 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 @@ 
                         _("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)