[PATCH] rust: clean remains of direct-ffi code
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Tue Mar 10 13:49:16 UTC 2020
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1583846648 -3600
# Tue Mar 10 14:24:08 2020 +0100
# Node ID 3e9fa97f5932c6262c7323edc68c0737fe34af76
# Parent b3991b72d9f15a092befdb499d0ec4891e432466
# EXP-Topic direct-ffi-cleanup
# Available At https://dev.heptapod.net/octobus/mercurial-devel/
# hg pull https://dev.heptapod.net/octobus/mercurial-devel/ -r 3e9fa97f5932
rust: clean remains of direct-ffi code
Since b55bec1ea972, the cext entry poitn have been removed, so we drop the code
for consistency.
diff --git a/mercurial/ancestor.py b/mercurial/ancestor.py
--- a/mercurial/ancestor.py
+++ b/mercurial/ancestor.py
@@ -393,39 +393,3 @@ class lazyancestors(object):
# 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
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -945,9 +945,6 @@ class revlog(object):
if rustancestor is not None:
lazyancestors = rustancestor.LazyAncestors
arg = self.index
- elif util.safehasattr(parsers, b'rustlazyancestors'):
- lazyancestors = ancestor.rustlazyancestors
- arg = self.index
else:
lazyancestors = ancestor.lazyancestors
arg = self._uncheckedparentrevs
More information about the Mercurial-devel
mailing list