95 REVIDX_FLAGS_ORDER |
95 REVIDX_FLAGS_ORDER |
96 REVIDX_KNOWN_FLAGS |
96 REVIDX_KNOWN_FLAGS |
97 REVIDX_RAWTEXT_CHANGING_FLAGS |
97 REVIDX_RAWTEXT_CHANGING_FLAGS |
98 |
98 |
99 parsers = policy.importmod(r'parsers') |
99 parsers = policy.importmod(r'parsers') |
|
100 try: |
|
101 from . import rustext |
|
102 rustext.__name__ # force actual import (see hgdemandimport) |
|
103 except ImportError: |
|
104 rustext = None |
100 |
105 |
101 # Aliased for performance. |
106 # Aliased for performance. |
102 _zlibdecompress = zlib.decompress |
107 _zlibdecompress = zlib.decompress |
103 |
108 |
104 # max size of revlog with inline data |
109 # max size of revlog with inline data |
777 revs = list(revs) |
782 revs = list(revs) |
778 checkrev = self.node |
783 checkrev = self.node |
779 for r in revs: |
784 for r in revs: |
780 checkrev(r) |
785 checkrev(r) |
781 # and we're sure ancestors aren't filtered as well |
786 # and we're sure ancestors aren't filtered as well |
782 if util.safehasattr(parsers, 'rustlazyancestors'): |
787 |
783 return ancestor.rustlazyancestors( |
788 if rustext is not None: |
784 self.index, revs, |
789 lazyancestors = rustext.ancestor.LazyAncestors |
785 stoprev=stoprev, inclusive=inclusive) |
790 arg = self.index |
786 return ancestor.lazyancestors(self._uncheckedparentrevs, revs, |
791 elif util.safehasattr(parsers, 'rustlazyancestors'): |
787 stoprev=stoprev, inclusive=inclusive) |
792 lazyancestors = ancestor.rustlazyancestors |
|
793 arg = self.index |
|
794 else: |
|
795 lazyancestors = ancestor.lazyancestors |
|
796 arg = self._uncheckedparentrevs |
|
797 return lazyancestors(arg, revs, stoprev=stoprev, inclusive=inclusive) |
788 |
798 |
789 def descendants(self, revs): |
799 def descendants(self, revs): |
790 return dagop.descendantrevs(revs, self.revs, self.parentrevs) |
800 return dagop.descendantrevs(revs, self.revs, self.parentrevs) |
791 |
801 |
792 def findcommonmissing(self, common=None, heads=None): |
802 def findcommonmissing(self, common=None, heads=None): |