##// END OF EJS Templates
rust: clean remains of direct-ffi code...
marmoute -
r44975:fb16ad36 default
parent child Browse files
Show More
@@ -393,39 +393,3 b' class lazyancestors(object):'
393 # free up memory.
393 # free up memory.
394 self._containsiter = None
394 self._containsiter = None
395 return False
395 return False
396
397
398 class rustlazyancestors(object):
399 def __init__(self, index, revs, stoprev=0, inclusive=False):
400 self._index = index
401 self._stoprev = stoprev
402 self._inclusive = inclusive
403 # no need to prefilter out init revs that are smaller than stoprev,
404 # it's done by rustlazyancestors constructor.
405 # we need to convert to a list, because our ruslazyancestors
406 # constructor (from C code) doesn't understand anything else yet
407 self._initrevs = initrevs = list(revs)
408
409 self._containsiter = parsers.rustlazyancestors(
410 index, initrevs, stoprev, inclusive
411 )
412
413 def __nonzero__(self):
414 """False if the set is empty, True otherwise.
415
416 It's better to duplicate this essentially trivial method than
417 to subclass lazyancestors
418 """
419 try:
420 next(iter(self))
421 return True
422 except StopIteration:
423 return False
424
425 def __iter__(self):
426 return parsers.rustlazyancestors(
427 self._index, self._initrevs, self._stoprev, self._inclusive
428 )
429
430 def __contains__(self, target):
431 return target in self._containsiter
@@ -945,9 +945,6 b' class revlog(object):'
945 if rustancestor is not None:
945 if rustancestor is not None:
946 lazyancestors = rustancestor.LazyAncestors
946 lazyancestors = rustancestor.LazyAncestors
947 arg = self.index
947 arg = self.index
948 elif util.safehasattr(parsers, b'rustlazyancestors'):
949 lazyancestors = ancestor.rustlazyancestors
950 arg = self.index
951 else:
948 else:
952 lazyancestors = ancestor.lazyancestors
949 lazyancestors = ancestor.lazyancestors
953 arg = self._uncheckedparentrevs
950 arg = self._uncheckedparentrevs
General Comments 0
You need to be logged in to leave comments. Login now