comparison hgext/evolve.py @ 1384:64c8b8c27811 stable

evolve: move 'allprecursors()' 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:13 -0700
parents cf62abb62941
children c2584407afbf
comparison
equal deleted inserted replaced
1383:cf62abb62941 1384:64c8b8c27811
441 cs = set() 441 cs = set()
442 for p in seen: 442 for p in seen:
443 pr = nm.get(p) 443 pr = nm.get(p)
444 if pr is not None: 444 if pr is not None:
445 cs.add(pr) 445 cs.add(pr)
446 cs -= repo.changelog.filteredrevs # nodemap has no filtering
446 return cs 447 return cs
447 448
448 def _successors(repo, s): 449 def _successors(repo, s):
449 """Successors of a changeset""" 450 """Successors of a changeset"""
450 cs = set() 451 cs = set()
525 def revsetallprecursors(repo, subset, x): 526 def revsetallprecursors(repo, subset, x):
526 """``allprecursors(set)`` 527 """``allprecursors(set)``
527 Transitive precursors of changesets in set. 528 Transitive precursors of changesets in set.
528 """ 529 """
529 s = revset.getset(repo, revset.fullreposet(repo), x) 530 s = revset.getset(repo, revset.fullreposet(repo), x)
530 cs = _allprecursors(repo, s) 531 s = revset.baseset(_allprecursors(repo, s))
531 return [r for r in subset if r in cs] 532 s.sort()
533 return subset & s
532 534
533 535
534 @eh.revset('successors') 536 @eh.revset('successors')
535 def revsetsuccessors(repo, subset, x): 537 def revsetsuccessors(repo, subset, x):
536 """``successors(set)`` 538 """``successors(set)``