mercurial/revset.py
branchstable
changeset 39802 3bc4fce0167f
parent 39801 cb5134f2318a
child 39803 0561e69ed9f1
equal deleted inserted replaced
39801:cb5134f2318a 39802:3bc4fce0167f
   622     return subset & baseset(ancs)
   622     return subset & baseset(ancs)
   623 
   623 
   624 @predicate('commonancestors(set)', safe=True)
   624 @predicate('commonancestors(set)', safe=True)
   625 def commonancestors(repo, subset, x):
   625 def commonancestors(repo, subset, x):
   626     """Returns all common ancestors of the set.
   626     """Returns all common ancestors of the set.
   627 
       
   628     This method is for calculating "::x and ::y" (i.e. all the ancestors that
       
   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
       
   631     in the repo (whereas we want "::x *and* ::y").
       
   632 
       
   633     """
   627     """
   634     startrevs = getset(repo, fullreposet(repo), x, order=anyorder)
   628     startrevs = getset(repo, fullreposet(repo), x, order=anyorder)
   635     if not startrevs:
   629     if not startrevs:
   636         return baseset()
   630         return baseset()
   637     for r in startrevs:
   631     for r in startrevs: