##// END OF EJS Templates
revlog: optimize ancestors() to not check filtered revisions for each...
Yuya Nishihara -
r40188:adbf8ca2 default
parent child Browse files
Show More
@@ -648,6 +648,9 b' class revlog(object):'
648 648
649 649 return entry[5], entry[6]
650 650
651 # fast parentrevs(rev) where rev isn't filtered
652 _uncheckedparentrevs = parentrevs
653
651 654 def node(self, rev):
652 655 try:
653 656 return self.index[rev][7]
@@ -747,8 +750,14 b' class revlog(object):'
747 750
748 751 See the documentation for ancestor.lazyancestors for more details."""
749 752
750 return ancestor.lazyancestors(self.parentrevs, revs, stoprev=stoprev,
751 inclusive=inclusive)
753 # first, make sure start revisions aren't filtered
754 revs = list(revs)
755 checkrev = self.node
756 for r in revs:
757 checkrev(r)
758 # and we're sure ancestors aren't filtered as well
759 return ancestor.lazyancestors(self._uncheckedparentrevs, revs,
760 stoprev=stoprev, inclusive=inclusive)
752 761
753 762 def descendants(self, revs):
754 763 return dagop.descendantrevs(revs, self.revs, self.parentrevs)
General Comments 0
You need to be logged in to leave comments. Login now