diff -r 384ecbc8f8ca -r 8de68446a5bd mercurial/revlog.py --- a/mercurial/revlog.py Thu Feb 13 13:10:11 2025 +0100 +++ b/mercurial/revlog.py Thu Feb 13 13:13:05 2025 +0100 @@ -209,28 +209,34 @@ node = attr.ib(default=None, type=Optional[bytes]) -def parse_index_v1(data, inline): +def parse_index_v1(data, inline, uses_generaldelta): # call the C implementation to parse the index data - index, cache = parsers.parse_index2(data, inline) + index, cache = parsers.parse_index2(data, inline, uses_generaldelta) return index, cache -def parse_index_v2(data, inline): +def parse_index_v2(data, inline, uses_generaldelta): # call the C implementation to parse the index data - index, cache = parsers.parse_index2(data, inline, format=REVLOGV2) + index, cache = parsers.parse_index2( + data, inline, uses_generaldelta, format=REVLOGV2 + ) return index, cache -def parse_index_cl_v2(data, inline): +def parse_index_cl_v2(data, inline, uses_generaldelta): # call the C implementation to parse the index data - index, cache = parsers.parse_index2(data, inline, format=CHANGELOGV2) + index, cache = parsers.parse_index2( + data, inline, uses_generaldelta, format=CHANGELOGV2 + ) return index, cache if hasattr(parsers, 'parse_index_devel_nodemap'): - def parse_index_v1_nodemap(data, inline): - index, cache = parsers.parse_index_devel_nodemap(data, inline) + def parse_index_v1_nodemap(data, inline, uses_generaldelta): + index, cache = parsers.parse_index_devel_nodemap( + data, inline, uses_generaldelta + ) return index, cache else: @@ -519,11 +525,10 @@ revs in ascending order and ``stopped`` is a bool indicating whether ``stoprev`` was hit. """ - generaldelta = self.delta_config.general_delta # Try C implementation. try: return self.index.deltachain( - rev, stoprev, generaldelta + rev, stoprev ) # pytype: disable=attribute-error except AttributeError: pass @@ -532,6 +537,7 @@ # Alias to prevent attribute lookup in tight loop. index = self.index + generaldelta = self.delta_config.general_delta iterrev = rev e = index[iterrev] @@ -1814,7 +1820,9 @@ self.uses_rust = True else: try: - d = self._parse_index(index_data, self._inline) + d = self._parse_index( + index_data, self._inline, self.delta_config.general_delta + ) index, chunkcache = d self._register_nodemap_info(index) except (ValueError, IndexError):