revlog: always use a Rust index for REVLOGv1 if rustext is present
authorGeorges Racinet on incendie.racinet.fr <georges@racinet.fr>
Fri, 27 Oct 2023 23:29:29 +0200
changeset 51238 633408a0f2e2
parent 51237 49b00a04028f
child 51239 7eea2e4109ae
revlog: always use a Rust index for REVLOGv1 if rustext is present We are about to change classes such as `rustext.AncestorsIterator` to take a Rust index, hence we cannot have the option not to use the Rust index. Note: this can be refined depending on whether we want to keep this option or not. We will have to make two versions of `AncestorsIterator` and its sibling to support REVLOGV2 and CHANGELOGv2 anyway. Meanwhile, this is the simplest change to make the tests pass.
mercurial/revlog.py
--- a/mercurial/revlog.py	Sun Oct 29 18:35:32 2023 +0100
+++ b/mercurial/revlog.py	Fri Oct 27 23:29:29 2023 +0200
@@ -1683,7 +1683,10 @@
             if self._nodemap_file is not None:
                 use_rust_index = True
             else:
-                use_rust_index = self.opener.options.get(b'rust.index')
+                # Using the CIndex is not longer possible, as the
+                # `AncestorsIterator` and `LazyAncestors` classes now require
+                # a Rust index for instantiation.
+                use_rust_index = True
 
         self._parse_index = parse_index_v1
         if self._format_version == REVLOGV0: