diff tests/test-rust-revlog.py @ 51239:7eea2e4109ae

rust-index: using the `hg::index::Index` in ancestors iterator and lazy set Since there is no Rust implementation for REVLOGV2/CHANGELOGv2, we declare them to be incompatible with Rust, hence indexes in these formats will use the implementations from Python `mercurial.ancestor`. If this is an unacceptable performance hit for current users of these formats, we can later on add Rust implementations based on the C index for them or implement these formats for the Rust indexes. Among the challenges that we had to meet, we wanted to avoid taking the GIL each time the inner (vcsgraph) iterator has to call the parents function. This would probably still be acceptable in terms of performance with `AncestorsIterator`, but not with `LazyAncestors` nor for the upcoming change in `MissingAncestors`. Hence we enclose the reference to the index in a `PySharedRef`, leading to more rigourous checking of mutations, which does pass now that there no logically immutable methods of `hg::index::Index` that take a mutable reference as input.
author Georges Racinet <georges.racinet@octobus.net>
date Fri, 27 Oct 2023 22:11:05 +0200
parents 13f58ce70299
children 2966b88d4531
line wrap: on
line diff
--- a/tests/test-rust-revlog.py	Fri Oct 27 23:29:29 2023 +0200
+++ b/tests/test-rust-revlog.py	Fri Oct 27 22:11:05 2023 +0200
@@ -54,7 +54,7 @@
         self.assertEqual(list(lazy), [3, 2, 1, 0])
 
         # let's check bool for an empty one
-        self.assertFalse(LazyAncestors(idx, [0], 0, False))
+        self.assertFalse(LazyAncestors(rustidx, [0], 0, False))
 
 
 if __name__ == '__main__':