changeset 9843:d1043c2ffe6c

merge: fix changectx.ancestor(workingctx) (issue1327)
author Matt Mackall <mpm@selenic.com>
date Thu, 12 Nov 2009 12:03:39 -0600
parents d3dbdca92458
children 004bf1d6e6af
files mercurial/context.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Thu Nov 12 16:39:11 2009 +0100
+++ b/mercurial/context.py	Thu Nov 12 12:03:39 2009 -0600
@@ -164,7 +164,11 @@
         """
         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):