diff tests/test-rust-revlog.py @ 51272:0409bd6ba663

rust-revlog: add invalidation detection to `NodeTree` class This will be useful for callers, such as `scmutil` who reuse a `NodeTree` instance as a cache. They would otherwise get hard errors if any mutation of the index occurred since instantiation. This is something the C index does not provide.
author Georges Racinet <georges.racinet@octobus.net>
date Mon, 30 Oct 2023 22:36:30 +0100
parents 2966b88d4531
children 96e05f1a99bd
line wrap: on
line diff
--- a/tests/test-rust-revlog.py	Thu Nov 02 15:50:13 2023 +0100
+++ b/tests/test-rust-revlog.py	Mon Oct 30 22:36:30 2023 +0100
@@ -87,6 +87,10 @@
             self.assertEqual(shortest, expected)
             self.assertEqual(nt.prefix_rev_lookup(hex_node[:shortest]), i)
 
+        # test invalidation (generation poisoning) detection
+        del idx[3]
+        self.assertTrue(nt.is_invalidated())
+
 
 if __name__ == '__main__':
     import silenttestrunner