diff mercurial/revlog.py @ 51253:96e05f1a99bd

rust-index: stop instantiating a C Index The only missing piece was the `cache` to be returned from `revlog.parse_index_v1_mixed`, and it really seems that it is essentially repetition of the input, if `inline` is `True`. Not worth a Rust implementation (C implementation is probably there for historical reasons).
author Georges Racinet <georges.racinet@octobus.net>
date Sun, 29 Oct 2023 23:54:05 +0100
parents 633408a0f2e2
children f94c10334bcb
line wrap: on
line diff
--- a/mercurial/revlog.py	Mon Oct 30 21:28:30 2023 +0100
+++ b/mercurial/revlog.py	Sun Oct 29 23:54:05 2023 +0100
@@ -226,8 +226,8 @@
 
 
 def parse_index_v1_mixed(data, inline, default_header):
-    index, cache = parse_index_v1(data, inline)
-    return rustrevlog.MixedIndex(index, data, default_header), cache
+    cache = (0, data) if inline else None
+    return rustrevlog.MixedIndex(data, default_header), cache
 
 
 # corresponds to uncompressed length of indexformatng (2 gigs, 4-byte