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).
This commit is contained in:
Mads Kiilerich 2014-08-19 01:13:10 +02:00
parent f40198b86f
commit fae32dd0a3
3 changed files with 8 additions and 7 deletions

View File

@ -542,9 +542,11 @@ class changectx(basectx):
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 @@ class committablectx(basectx):
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):

View File

@ -753,7 +753,7 @@ class revlog(object):
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:

View File

@ -97,8 +97,7 @@ Should fail because merge with other branch:
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: