comparison hgext/evolve.py @ 1380:43dcf62237be stable

evolve: avoid creating changectx object in _allsuccessors 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:32 -0700
parents 693cdcd809f2
children 61849d45d47e
comparison
equal deleted inserted replaced
1379:693cdcd809f2 1380:43dcf62237be
457 def _allsuccessors(repo, s, haltonflags=0): # XXX we need a better naming 457 def _allsuccessors(repo, s, haltonflags=0): # XXX we need a better naming
458 """transitive successors of a subset 458 """transitive successors of a subset
459 459
460 haltonflags allows to provide flags which prevent the evaluation of a 460 haltonflags allows to provide flags which prevent the evaluation of a
461 marker. """ 461 marker. """
462 toproceed = [repo[r].node() for r in s] 462 node = repo.changelog.node
463 toproceed = [node(r) for r in s]
463 seen = set() 464 seen = set()
464 allobjects = repo.obsstore.successors 465 allobjects = repo.obsstore.successors
465 while toproceed: 466 while toproceed:
466 nc = toproceed.pop() 467 nc = toproceed.pop()
467 for mark in allobjects.get(nc, ()): 468 for mark in allobjects.get(nc, ()):