evolve: avoid creating changectx object in _precursors stable
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 18 Jun 2015 16:13:15 -0700
branchstable
changeset 1377 01bdeb847f81
parent 1376 8bb2e04cc18c
child 1378 a127f0f3bf5f
evolve: avoid creating changectx object in _precursors The repo lookups and object creations have a significant performance overhead.
hgext/evolve.py
--- a/hgext/evolve.py	Thu Jun 18 16:18:29 2015 -0700
+++ b/hgext/evolve.py	Thu Jun 18 16:13:15 2015 -0700
@@ -411,8 +411,9 @@
     cs = set()
     nm = repo.changelog.nodemap
     markerbysubj = repo.obsstore.precursors
+    node = repo.changelog.node
     for r in s:
-        for p in markerbysubj.get(repo[r].node(), ()):
+        for p in markerbysubj.get(node(r), ()):
             pr = nm.get(p[0])
             if pr is not None:
                 cs.add(pr)