Mercurial > hg
changeset 11453:2ee26044d846 stable
context: allow passing the common cset ancestor to fctx.ancestor
This is used by the next patch to speed up merge.applyupdates.
author | Peter Arrenbrecht <peter.arrenbrecht@gmail.com> |
---|---|
date | Fri, 18 Jun 2010 08:48:05 +0200 |
parents | eac141407b85 |
children | 9b0406b23be0 |
files | mercurial/context.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Sun Jun 27 17:41:43 2010 -0500 +++ b/mercurial/context.py Fri Jun 18 08:48:05 2010 +0200 @@ -490,12 +490,16 @@ return zip(hist[f][0], hist[f][1].splitlines(True)) - def ancestor(self, fc2): + def ancestor(self, fc2, actx=None): """ 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 + of self's and fc2's respective changesets. """ - actx = self.changectx().ancestor(fc2.changectx()) + if actx is None: + actx = self.changectx().ancestor(fc2.changectx()) # the trivial case: changesets are unrelated, files must be too if not actx: