Mercurial > hg
diff mercurial/ancestor.py @ 44491:fb16ad368606
rust: clean remains of direct-ffi code
Since b55bec1ea972, the cext entry poitn have been removed, so we drop the code
for consistency.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 10 Mar 2020 14:24:08 +0100 |
parents | 9d2b2df2c2ba |
children | 89a2afe31e82 |
line wrap: on
line diff
--- a/mercurial/ancestor.py Fri Mar 06 17:02:50 2020 +0100 +++ b/mercurial/ancestor.py Tue Mar 10 14:24:08 2020 +0100 @@ -393,39 +393,3 @@ # free up memory. self._containsiter = None return False - - -class rustlazyancestors(object): - def __init__(self, index, revs, stoprev=0, inclusive=False): - self._index = index - self._stoprev = stoprev - self._inclusive = inclusive - # no need to prefilter out init revs that are smaller than stoprev, - # it's done by rustlazyancestors constructor. - # we need to convert to a list, because our ruslazyancestors - # constructor (from C code) doesn't understand anything else yet - self._initrevs = initrevs = list(revs) - - self._containsiter = parsers.rustlazyancestors( - index, initrevs, stoprev, inclusive - ) - - def __nonzero__(self): - """False if the set is empty, True otherwise. - - It's better to duplicate this essentially trivial method than - to subclass lazyancestors - """ - try: - next(iter(self)) - return True - except StopIteration: - return False - - def __iter__(self): - return parsers.rustlazyancestors( - self._index, self._initrevs, self._stoprev, self._inclusive - ) - - def __contains__(self, target): - return target in self._containsiter