mercurial/context.py
changeset 9751 f8ca4035a949
parent 9750 f153af9580fe
child 9843 d1043c2ffe6c
equal deleted inserted replaced
9750:f153af9580fe 9751:f8ca4035a949
   450         """
   450         """
   451         find the common ancestor file context, if any, of self, and fc2
   451         find the common ancestor file context, if any, of self, and fc2
   452         """
   452         """
   453 
   453 
   454         actx = self.changectx().ancestor(fc2.changectx())
   454         actx = self.changectx().ancestor(fc2.changectx())
   455         if self.path() in actx:
   455 
       
   456         # the trivial case: changesets are unrelated, files must be too
       
   457         if not actx:
       
   458             return None
       
   459 
       
   460         # the easy case: no (relevant) renames
       
   461         if fc2.path() == self.path() and self.path() in actx:
   456             return actx[self.path()]
   462             return actx[self.path()]
   457 
       
   458         acache = {}
   463         acache = {}
   459 
   464 
   460         # prime the ancestor cache for the working directory
   465         # prime the ancestor cache for the working directory
   461         for c in (self, fc2):
   466         for c in (self, fc2):
   462             if c._filerev is None:
   467             if c._filerev is None: