comparison hgext/evolve.py @ 1386:b5eaec8a53d0 stable

evolve: move 'allsuccessors()' to smarted usage The "new" smarted can be significantly more efficient than the old was. We convert our revset to take advantage of that.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 18 Jun 2015 16:15:28 -0700
parents c2584407afbf
children c96e4ab4e5cc 87aceaed5c69
comparison
equal deleted inserted replaced
1385:c2584407afbf 1386:b5eaec8a53d0
485 cs = set() 485 cs = set()
486 for s in seen: 486 for s in seen:
487 sr = nm.get(s) 487 sr = nm.get(s)
488 if sr is not None: 488 if sr is not None:
489 cs.add(sr) 489 cs.add(sr)
490 cs -= repo.changelog.filteredrevs # nodemap has no filtering
490 return cs 491 return cs
491 492
492 493
493 494
494 495
548 def revsetallsuccessors(repo, subset, x): 549 def revsetallsuccessors(repo, subset, x):
549 """``allsuccessors(set)`` 550 """``allsuccessors(set)``
550 Transitive successors of changesets in set. 551 Transitive successors of changesets in set.
551 """ 552 """
552 s = revset.getset(repo, revset.fullreposet(repo), x) 553 s = revset.getset(repo, revset.fullreposet(repo), x)
553 cs = _allsuccessors(repo, s) 554 s = revset.baseset(_allsuccessors(repo, s))
554 return [r for r in subset if r in cs] 555 s.sort()
556 return subset & s
555 557
556 ### template keywords 558 ### template keywords
557 # XXX it does not handle troubles well :-/ 559 # XXX it does not handle troubles well :-/
558 560
559 @eh.templatekw('obsolete') 561 @eh.templatekw('obsolete')