comparison mercurial/context.py @ 11453:2ee26044d846 stable

context: allow passing the common cset ancestor to fctx.ancestor This is used by the next patch to speed up merge.applyupdates.
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
date Fri, 18 Jun 2010 08:48:05 +0200
parents a1aad8333864
children 16fe98804fd8
comparison
equal deleted inserted replaced
11452:eac141407b85 11453:2ee26044d846
488 del hist[p] 488 del hist[p]
489 hist[f] = curr 489 hist[f] = curr
490 490
491 return zip(hist[f][0], hist[f][1].splitlines(True)) 491 return zip(hist[f][0], hist[f][1].splitlines(True))
492 492
493 def ancestor(self, fc2): 493 def ancestor(self, fc2, actx=None):
494 """ 494 """
495 find the common ancestor file context, if any, of self, and fc2 495 find the common ancestor file context, if any, of self, and fc2
496
497 If actx is given, it must be the changectx of the common ancestor
498 of self's and fc2's respective changesets.
496 """ 499 """
497 500
498 actx = self.changectx().ancestor(fc2.changectx()) 501 if actx is None:
502 actx = self.changectx().ancestor(fc2.changectx())
499 503
500 # the trivial case: changesets are unrelated, files must be too 504 # the trivial case: changesets are unrelated, files must be too
501 if not actx: 505 if not actx:
502 return None 506 return None
503 507