Mercurial > hg
changeset 16599:4b73f4ba27ca
filectx: make ancestor require actx
When grafting or rebasing, we need to know the target ancestor.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 04 May 2012 17:27:14 -0500 |
parents | 4878914b02ab |
children | b54f3c502e63 |
files | mercurial/context.py |
diffstat | 1 files changed, 2 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Mon May 07 13:40:58 2012 +0200 +++ b/mercurial/context.py Fri May 04 17:27:14 2012 -0500 @@ -634,21 +634,14 @@ return zip(hist[base][0], hist[base][1].splitlines(True)) - def ancestor(self, fc2, actx=None): + def ancestor(self, fc2, actx): """ find the common ancestor file context, if any, of self, and fc2 - If actx is given, it must be the changectx of the common ancestor + actx must be the changectx of the common ancestor of self's and fc2's respective changesets. """ - if actx is None: - actx = self.changectx().ancestor(fc2.changectx()) - - # the trivial case: changesets are unrelated, files must be too - if not actx: - return None - # the easy case: no (relevant) renames if fc2.path() == self.path() and self.path() in actx: return actx[self.path()]