diff mercurial/revlog.py @ 48769:1bb62821f080

revlog: register changelogv2 C implementation in parsers This allows Python code to make use of the C implementation of the changelogv2 base operations when the C extensions are enabled. The `format_version` values are now shared between the C and Python sides, avoiding an additional translation for the selection of the format version to use. Differential Revision: https://phab.mercurial-scm.org/D12179
author pacien <pacien.trangirard@pacien.net>
date Mon, 07 Feb 2022 13:23:58 +0100
parents 580660518459
children d739cd69bb6a
line wrap: on
line diff
--- a/mercurial/revlog.py	Mon Feb 14 12:34:02 2022 +0100
+++ b/mercurial/revlog.py	Mon Feb 07 13:23:58 2022 +0100
@@ -103,6 +103,7 @@
 REVLOGV0
 REVLOGV1
 REVLOGV2
+CHANGELOGV2
 FLAG_INLINE_DATA
 FLAG_GENERALDELTA
 REVLOG_DEFAULT_FLAGS
@@ -201,16 +202,13 @@
 
 def parse_index_v2(data, inline):
     # call the C implementation to parse the index data
-    index, cache = parsers.parse_index2(data, inline, revlogv2=True)
+    index, cache = parsers.parse_index2(data, inline, format=REVLOGV2)
     return index, cache
 
 
 def parse_index_cl_v2(data, inline):
     # call the C implementation to parse the index data
-    assert not inline
-    from .pure.parsers import parse_index_cl_v2
-
-    index, cache = parse_index_cl_v2(data)
+    index, cache = parsers.parse_index2(data, inline, format=CHANGELOGV2)
     return index, cache