mercurial/context.py
changeset 9751 f8ca4035a949
parent 9750 f153af9580fe
child 9843 d1043c2ffe6c
--- a/mercurial/context.py	Sat Nov 07 14:07:45 2009 -0600
+++ b/mercurial/context.py	Sat Nov 07 14:07:45 2009 -0600
@@ -452,9 +452,14 @@
         """
 
         actx = self.changectx().ancestor(fc2.changectx())
-        if self.path() in actx:
+
+        # 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()]
-
         acache = {}
 
         # prime the ancestor cache for the working directory