cmdutil: store a local ref to repo.hiddenrevs in getgraphlogrevs
authorSiddharth Agarwal <sid0@fb.com>
Fri, 28 Dec 2012 16:24:36 -0800
changeset 18170 0dcc77b271b9
parent 18169 ae663cba9a8d
child 18171 9d350f2d9458
cmdutil: store a local ref to repo.hiddenrevs in getgraphlogrevs On a repository with over 400,000 changesets, this speeds graphlog up by around 0.03 seconds (~20% with a small limit).
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Fri Dec 28 14:46:58 2012 -0800
+++ b/mercurial/cmdutil.py	Fri Dec 28 16:24:36 2012 -0800
@@ -1453,7 +1453,8 @@
     if not opts.get('hidden'):
         # --hidden is still experimental and not worth a dedicated revset
         # yet. Fortunately, filtering revision number is fast.
-        revs = (r for r in revs if r not in repo.hiddenrevs)
+        hiddenrevs = repo.hiddenrevs
+        revs = (r for r in revs if r not in hiddenrevs)
     else:
         revs = iter(revs)
     return revs, expr, filematcher