comparison mercurial/revset.py @ 39802:3bc4fce0167f stable

revset: remove part of the commonancestors() comment The reason is that: - it shows up in "hg help revset", but it doesn't look like documentation targeted at users - it doesn't make sense to me: it doesn't say what happens with < 2 revisions, and is not quite right because my understanding is that this revset was created precisely because "::x and ::y" was not quite the same (when x and y don't evaluate to singletons). Differential Revision: https://phab.mercurial-scm.org/D4739
author Valentin Gatien-Baron <vgatien-baron@janestreet.com>
date Tue, 25 Sep 2018 16:14:57 -0400
parents cb5134f2318a
children 0561e69ed9f1
comparison
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: