##// 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 return entry[5], entry[6]
649 return entry[5], entry[6]
650
650
651 # fast parentrevs(rev) where rev isn't filtered
652 _uncheckedparentrevs = parentrevs
653
651 def node(self, rev):
654 def node(self, rev):
652 try:
655 try:
653 return self.index[rev][7]
656 return self.index[rev][7]
@@ -747,8 +750,14 b' class revlog(object):'
747
750
748 See the documentation for ancestor.lazyancestors for more details."""
751 See the documentation for ancestor.lazyancestors for more details."""
749
752
750 return ancestor.lazyancestors(self.parentrevs, revs, stoprev=stoprev,
753 # first, make sure start revisions aren't filtered
751 inclusive=inclusive)
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 def descendants(self, revs):
762 def descendants(self, revs):
754 return dagop.descendantrevs(revs, self.revs, self.parentrevs)
763 return dagop.descendantrevs(revs, self.revs, self.parentrevs)
General Comments 0
You need to be logged in to leave comments. Login now