mercurial/revset.py
branchstable
changeset 39801 cb5134f2318a
parent 38705 e4b270a32ba8
child 39802 3bc4fce0167f
equal deleted inserted replaced
39800:572cd30eaffb 39801: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