comparison hgext/evolve.py @ 1379:693cdcd809f2 stable

evolve: avoid creating changectx object in _successors The repo lookups and object creations have a significant performance overhead.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 18 Jun 2015 16:14:16 -0700
parents a127f0f3bf5f
children 43dcf62237be
comparison
equal deleted inserted replaced
1378:a127f0f3bf5f 1379:693cdcd809f2
441 return cs 441 return cs
442 442
443 def _successors(repo, s): 443 def _successors(repo, s):
444 """Successors of a changeset""" 444 """Successors of a changeset"""
445 cs = set() 445 cs = set()
446 node = repo.changelog.node
446 nm = repo.changelog.nodemap 447 nm = repo.changelog.nodemap
447 markerbyobj = repo.obsstore.successors 448 markerbyobj = repo.obsstore.successors
448 for r in s: 449 for r in s:
449 for p in markerbyobj.get(repo[r].node(), ()): 450 for p in markerbyobj.get(node(r), ()):
450 for sub in p[1]: 451 for sub in p[1]:
451 sr = nm.get(sub) 452 sr = nm.get(sub)
452 if sr is not None: 453 if sr is not None:
453 cs.add(sr) 454 cs.add(sr)
454 return cs 455 return cs