diff contrib/perf.py @ 52896:8de68446a5bd

index: remember the generaldelta config instead of getting it from the revlog The code (especially the Rust code) was jumping in 4 dimensions to make sense of what was going on because it wrongly assumed that we needed to somehow be able to ask a generaldelta index for a non-generaldelta delta chain, which doesn't make any sense. Removing the cargo-culted/vestigial code, this is cleaner and less confusing.
author Rapha?l Gom?s <rgomes@octobus.net>
date Thu, 13 Feb 2025 13:13:05 +0100
parents 6a7b0d0f090d
children
line wrap: on
line diff
--- a/contrib/perf.py	Thu Feb 13 13:10:11 2025 +0100
+++ b/contrib/perf.py	Thu Feb 13 13:13:05 2025 +0100
@@ -3313,6 +3313,14 @@
     if parse_index_v1 is None:
         parse_index_v1 = mercurial.revlog.revlogio().parseindex
 
+    uses_generaldelta = "uses_generaldelta" in getargspec(parse_index_v1).args
+    if uses_generaldelta is not None:
+        # Mercurial 7.0 and above
+        # This test isn't affected by generaldelta at all, so just pass `False`
+        parse_index_v1 = functools.partial(
+            parse_index_v1, uses_generaldelta=False
+        )
+
     rllen = len(rl)
 
     node0 = rl.node(0)