comparison mercurial/revset.py @ 38793:cb5134f2318a stable

revset: make commonancestors(x + x^) be ::(x^), not ::x Differential Revision: https://phab.mercurial-scm.org/D4738
author Valentin Gatien-Baron <vgatien-baron@janestreet.com>
date Tue, 25 Sep 2018 16:05:21 -0400
parents e4b270a32ba8
children 3bc4fce0167f
comparison
equal deleted inserted replaced
38792:572cd30eaffb 38793:cb5134f2318a
629 are common to both x and y) in an easy and optimized way. We can't quite 629 are common to both x and y) in an easy and optimized way. We can't quite
630 use "::head()" because that revset returns "::x + ::y + ..." for each head 630 use "::head()" because that revset returns "::x + ::y + ..." for each head
631 in the repo (whereas we want "::x *and* ::y"). 631 in the repo (whereas we want "::x *and* ::y").
632 632
633 """ 633 """
634 # only wants the heads of the set passed in 634 startrevs = getset(repo, fullreposet(repo), x, order=anyorder)
635 h = heads(repo, fullreposet(repo), x, anyorder) 635 if not startrevs:
636 if not h:
637 return baseset() 636 return baseset()
638 for r in h: 637 for r in startrevs:
639 subset &= dagop.revancestors(repo, baseset([r])) 638 subset &= dagop.revancestors(repo, baseset([r]))
640
641 return subset 639 return subset
642 640
643 @predicate('contains(pattern)', weight=100) 641 @predicate('contains(pattern)', weight=100)
644 def contains(repo, subset, x): 642 def contains(repo, subset, x):
645 """The revision's manifest contains a file matching pattern (but might not 643 """The revision's manifest contains a file matching pattern (but might not