##// END OF EJS Templates
revlog: more efficient implementation for issnapshot...
Boris Feld -
r41116:84491ae0 default
parent child Browse files
Show More
@@ -1535,15 +1535,19 b' class revlog(object):'
1535 """
1535 """
1536 if rev == nullrev:
1536 if rev == nullrev:
1537 return True
1537 return True
1538 deltap = self.deltaparent(rev)
1538 entry = self.index[rev]
1539 if deltap == nullrev:
1539 base = entry[3]
1540 if base == rev:
1540 return True
1541 return True
1541 elif not self._sparserevlog:
1542 elif not self._sparserevlog:
1542 return False
1543 return False
1543 p1, p2 = self.parentrevs(rev)
1544 if base == nullrev:
1544 if deltap in (p1, p2):
1545 return True
1546 p1 = entry[5]
1547 p2 = entry[6]
1548 if base == p1 or base == p2:
1545 return False
1549 return False
1546 return self.issnapshot(deltap)
1550 return self.issnapshot(base)
1547
1551
1548 def snapshotdepth(self, rev):
1552 def snapshotdepth(self, rev):
1549 """number of snapshot in the chain before this one"""
1553 """number of snapshot in the chain before this one"""
General Comments 0
You need to be logged in to leave comments. Login now