Patchwork D4134: perf: call _generatechangelog() instead of group()

login
register
mail settings
Submitter phabricator
Date Aug. 9, 2018, 6:15 p.m.
Message ID <39ba4c26f346c3f6e75176b7de38de5a@localhost.localdomain>
Download mbox | patch
Permalink /patch/33491/
State Not Applicable
Headers show

Comments

phabricator - Aug. 9, 2018, 6:15 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa1f694779b2f: perf: call _generatechangelog() instead of group() (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4134?vs=10005&id=10141

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

AFFECTED FILES
  contrib/perf.py

CHANGE DETAILS




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

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -663,21 +663,20 @@ 
     By default, all revisions are added to the changegroup.
     """
     cl = repo.changelog
-    revs = [cl.lookup(r) for r in repo.revs(rev or 'all()')]
+    nodes = [cl.lookup(r) for r in repo.revs(rev or 'all()')]
     bundler = changegroup.getbundler(version, repo)
 
-    def lookup(node):
-        # The real bundler reads the revision in order to access the
-        # manifest node and files list. Do that here.
-        cl.read(node)
-        return node
-
     def d():
-        for chunk in bundler.group(revs, cl, lookup):
+        state, chunks = bundler._generatechangelog(cl, nodes)
+        for chunk in chunks:
             pass
 
     timer, fm = gettimer(ui, opts)
-    timer(d)
+
+    # Terminal printing can interfere with timing. So disable it.
+    with ui.configoverride({('progress', 'disable'): True}):
+        timer(d)
+
     fm.end()
 
 @command('perfdirs', formatteropts)