evolve: avoid creating changectx object in _successors stable
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 18 Jun 2015 16:14:16 -0700
branchstable
changeset 1379 693cdcd809f2
parent 1378 a127f0f3bf5f
child 1380 43dcf62237be
evolve: avoid creating changectx object in _successors The repo lookups and object creations have a significant performance overhead.
hgext/evolve.py
--- a/hgext/evolve.py	Thu Jun 18 16:13:35 2015 -0700
+++ b/hgext/evolve.py	Thu Jun 18 16:14:16 2015 -0700
@@ -443,10 +443,11 @@
 def _successors(repo, s):
     """Successors of a changeset"""
     cs = set()
+    node = repo.changelog.node
     nm = repo.changelog.nodemap
     markerbyobj = repo.obsstore.successors
     for r in s:
-        for p in markerbyobj.get(repo[r].node(), ()):
+        for p in markerbyobj.get(node(r), ()):
             for sub in p[1]:
                 sr = nm.get(sub)
                 if sr is not None: