filectx: make ancestor require actx
When grafting or rebasing, we need to know the target ancestor.
--- 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()]