##// END OF EJS Templates
rust-cpython: using the new bindings from Python...
Georges Racinet -
r41150:536c8353 default
parent child Browse files
Show More
@@ -97,6 +97,11 b' 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
@@ -779,12 +784,17 b' class revlog(object):'
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)
General Comments 0
You need to be logged in to leave comments. Login now