##// END OF EJS Templates
revlog: efficient implementation of 'descendant'...
Boris Feld -
r38532:6db38c9d default
parent child Browse files
Show More
@@ -1376,16 +1376,14 b' class revlog(object):'
1376 return c
1376 return c
1377
1377
1378 def descendant(self, start, end):
1378 def descendant(self, start, end):
1379 """True if revision 'end' is an descendant of revision 'start'
1380
1381 A revision is considered as a descendant of itself."""
1379 if start == nullrev:
1382 if start == nullrev:
1380 return True
1383 return True
1381 elif start == end:
1384 elif start == end:
1382 return True
1385 return True
1383 for i in self.descendants([start]):
1386 return start in self._commonancestorsheads(start, end)
1384 if i == end:
1385 return True
1386 elif i > end:
1387 break
1388 return False
1389
1387
1390 def commonancestorsheads(self, a, b):
1388 def commonancestorsheads(self, a, b):
1391 """calculate all the heads of the common ancestors of nodes a and b"""
1389 """calculate all the heads of the common ancestors of nodes a and b"""
General Comments 0
You need to be logged in to leave comments. Login now