diff -r f153af9580fe -r f8ca4035a949 mercurial/context.py --- 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