evolve: avoid creating changectx object in _allprecursors stable
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 18 Jun 2015 16:13:35 -0700
branchstable
changeset 1378 a127f0f3bf5f
parent 1377 01bdeb847f81
child 1379 693cdcd809f2
evolve: avoid creating changectx object in _allprecursors The repo lookups and object creations have a significant performance overhead.
hgext/evolve.py
--- a/hgext/evolve.py	Thu Jun 18 16:13:15 2015 -0700
+++ b/hgext/evolve.py	Thu Jun 18 16:13:35 2015 -0700
@@ -421,7 +421,8 @@
 
 def _allprecursors(repo, s):  # XXX we need a better naming
     """transitive precursors of a subset"""
-    toproceed = [repo[r].node() for r in s]
+    node = repo.changelog.node
+    toproceed = [node(r) for r in s]
     seen = set()
     allsubjects = repo.obsstore.precursors
     while toproceed: