comparison mercurial/revlog.py @ 51238:633408a0f2e2

revlog: always use a Rust index for REVLOGv1 if rustext is present We are about to change classes such as `rustext.AncestorsIterator` to take a Rust index, hence we cannot have the option not to use the Rust index. Note: this can be refined depending on whether we want to keep this option or not. We will have to make two versions of `AncestorsIterator` and its sibling to support REVLOGV2 and CHANGELOGv2 anyway. Meanwhile, this is the simplest change to make the tests pass.
author Georges Racinet on incendie.racinet.fr <georges@racinet.fr>
date Fri, 27 Oct 2023 23:29:29 +0200
parents 13f58ce70299
children 96e05f1a99bd
comparison
equal deleted inserted replaced
51237:49b00a04028f 51238:633408a0f2e2
1681 use_rust_index = False 1681 use_rust_index = False
1682 if rustrevlog is not None: 1682 if rustrevlog is not None:
1683 if self._nodemap_file is not None: 1683 if self._nodemap_file is not None:
1684 use_rust_index = True 1684 use_rust_index = True
1685 else: 1685 else:
1686 use_rust_index = self.opener.options.get(b'rust.index') 1686 # Using the CIndex is not longer possible, as the
1687 # `AncestorsIterator` and `LazyAncestors` classes now require
1688 # a Rust index for instantiation.
1689 use_rust_index = True
1687 1690
1688 self._parse_index = parse_index_v1 1691 self._parse_index = parse_index_v1
1689 if self._format_version == REVLOGV0: 1692 if self._format_version == REVLOGV0:
1690 self._parse_index = revlogv0.parse_index_v0 1693 self._parse_index = revlogv0.parse_index_v0
1691 elif self._format_version == REVLOGV2: 1694 elif self._format_version == REVLOGV2: