# HG changeset patch # User Matt Mackall # Date 2009-11-12 18:03:39 # Node ID d1043c2ffe6cb7c5669b7af8539bac726c6607f7 # Parent d3dbdca92458a522f41c0ccdc0c8d46865ee79c8 merge: fix changectx.ancestor(workingctx) (issue1327) diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -164,7 +164,11 @@ class changectx(object): """ return the ancestor context of self and c2 """ - n = self._repo.changelog.ancestor(self._node, c2._node) + # deal with workingctxs + n2 = c2._node + if n2 == None: + n2 = c2._parents[0]._node + n = self._repo.changelog.ancestor(self._node, n2) return changectx(self._repo, n) def walk(self, match):