# HG changeset patch # User Matt Mackall # Date 1336170434 18000 # Node ID 4b73f4ba27ca2990baab9334b878f80eacc87101 # Parent 4878914b02ab06c798a02f9d4e899a800e270589 filectx: make ancestor require actx When grafting or rebasing, we need to know the target ancestor. diff -r 4878914b02ab -r 4b73f4ba27ca mercurial/context.py --- 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()]