##// END OF EJS Templates
revlog: refactor out the rev-oriented part of commonancestorheads...
Boris Feld -
r38531:99f864b3 default
parent child Browse files
Show More
@@ -1390,11 +1390,16 b' class revlog(object):'
1390 def commonancestorsheads(self, a, b):
1390 def commonancestorsheads(self, a, b):
1391 """calculate all the heads of the common ancestors of nodes a and b"""
1391 """calculate all the heads of the common ancestors of nodes a and b"""
1392 a, b = self.rev(a), self.rev(b)
1392 a, b = self.rev(a), self.rev(b)
1393 ancs = self._commonancestorsheads(a, b)
1394 return pycompat.maplist(self.node, ancs)
1395
1396 def _commonancestorsheads(self, *revs):
1397 """calculate all the heads of the common ancestors of revs"""
1393 try:
1398 try:
1394 ancs = self.index.commonancestorsheads(a, b)
1399 ancs = self.index.commonancestorsheads(*revs)
1395 except (AttributeError, OverflowError): # C implementation failed
1400 except (AttributeError, OverflowError): # C implementation failed
1396 ancs = ancestor.commonancestorsheads(self.parentrevs, a, b)
1401 ancs = ancestor.commonancestorsheads(self.parentrevs, *revs)
1397 return pycompat.maplist(self.node, ancs)
1402 return ancs
1398
1403
1399 def isancestor(self, a, b):
1404 def isancestor(self, a, b):
1400 """return True if node a is an ancestor of node b
1405 """return True if node a is an ancestor of node b
General Comments 0
You need to be logged in to leave comments. Login now