rust: disable the RustIndex without persistent nodemap
See rational inline.
--- a/mercurial/revlog.py Fri Feb 23 03:44:56 2024 +0100
+++ b/mercurial/revlog.py Fri Feb 23 03:45:07 2024 +0100
@@ -1678,14 +1678,15 @@
)
use_rust_index = False
- if rustrevlog is not None:
- if self._nodemap_file is not None:
- use_rust_index = True
- else:
- # Using the CIndex is not longer possible, as the
- # `AncestorsIterator` and `LazyAncestors` classes now require
- # a Rust index for instantiation.
- use_rust_index = True
+ if rustrevlog is not None and self._nodemap_file is not None:
+ # we would like to use the rust_index in all case, especially
+ # because it is necessary for AncestorsIterator and LazyAncestors
+ # since the 6.7 cycle.
+ #
+ # However, the performance impact of inconditionnaly building the
+ # nodemap is currently a problem for non-persistent nodemap
+ # repository.
+ use_rust_index = True
self._parse_index = parse_index_v1
if self._format_version == REVLOGV0:
--- a/tests/test-verify.t Fri Feb 23 03:44:56 2024 +0100
+++ b/tests/test-verify.t Fri Feb 23 03:45:07 2024 +0100
@@ -311,8 +311,7 @@
$ cat start b > .hg/store/data/a.i
$ hg verify -q
- a@1: broken revlog! (index a is corrupted) (no-rust !)
- a@1: broken revlog! (abort: unexpected inline revlog length) (rust !)
+ a@1: broken revlog! (index a is corrupted)
warning: orphan data file 'data/a.i'
not checking dirstate because of previous errors
1 warnings encountered!