# HG changeset patch # User Mads Kiilerich # Date 1408403590 -7200 # Node ID 94f77624dbb58d57feab825ea3e9fab4626d9540 # Parent 0f0b204b399c56168678f0c416ab6ab1a77b14bc comments: describe ancestor consistently - avoid 'least common ancestor' "best" is as defined by mercurial.ancestor.ancestors: furthest from a root (as measured by longest path). diff -r 0f0b204b399c -r 94f77624dbb5 mercurial/context.py --- a/mercurial/context.py Tue Aug 19 01:12:56 2014 +0200 +++ b/mercurial/context.py Tue Aug 19 01:13:10 2014 +0200 @@ -542,9 +542,11 @@ changectx=self, filelog=filelog) def ancestor(self, c2, warn=False): - """ - return the "best" ancestor context of self and c2 - """ + """return the "best" ancestor context of self and c2 + + If there are multiple candidates, it will show a message and check + merge.preferancestor configuration before falling back to the + revlog ancestor.""" # deal with workingctxs n2 = c2._node if n2 is None: @@ -1146,7 +1148,7 @@ return '' def ancestor(self, c2): - """return the ancestor context of self and c2""" + """return the "best" ancestor context of self and c2""" return self._parents[0].ancestor(c2) # punt on two parents for now def walk(self, match): diff -r 0f0b204b399c -r 94f77624dbb5 mercurial/revlog.py --- a/mercurial/revlog.py Tue Aug 19 01:12:56 2014 +0200 +++ b/mercurial/revlog.py Tue Aug 19 01:13:10 2014 +0200 @@ -753,7 +753,7 @@ return a in self.commonancestorsheads(a, b) def ancestor(self, a, b): - """calculate the least common ancestor of nodes a and b""" + """calculate the "best" common ancestor of nodes a and b""" a, b = self.rev(a), self.rev(b) try: diff -r 0f0b204b399c -r 94f77624dbb5 tests/test-merge-default.t --- a/tests/test-merge-default.t Tue Aug 19 01:12:56 2014 +0200 +++ b/tests/test-merge-default.t Tue Aug 19 01:13:10 2014 +0200 @@ -97,8 +97,7 @@ Test for issue2043: ensure that 'merge -P' shows ancestors of 6 that -are not ancestors of 7, regardless of where their least common -ancestor is. +are not ancestors of 7, regardless of where their common ancestors are. Merge preview not affected by common ancestor: