comparison mercurial/revlog.py @ 47266:921648d31553

changelogv2: use a dedicated version number If we want to change the format, we need a new version number. We start with that. Differential Revision: https://phab.mercurial-scm.org/D10663
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 29 Mar 2021 20:46:56 +0200
parents 6c84fc9c9a90
children 6be2a7ca4b1d
comparison
equal deleted inserted replaced
47265:a07381751dc9 47266:921648d31553
33 ) 33 )
34 from .i18n import _ 34 from .i18n import _
35 from .pycompat import getattr 35 from .pycompat import getattr
36 from .revlogutils.constants import ( 36 from .revlogutils.constants import (
37 ALL_KINDS, 37 ALL_KINDS,
38 CHANGELOGV2,
38 COMP_MODE_DEFAULT, 39 COMP_MODE_DEFAULT,
39 COMP_MODE_INLINE, 40 COMP_MODE_INLINE,
40 COMP_MODE_PLAIN, 41 COMP_MODE_PLAIN,
41 FEATURES_BY_VERSION, 42 FEATURES_BY_VERSION,
42 FLAG_GENERALDELTA, 43 FLAG_GENERALDELTA,
458 """ 459 """
459 mmapindexthreshold = None 460 mmapindexthreshold = None
460 opts = self.opener.options 461 opts = self.opener.options
461 462
462 if b'changelogv2' in opts and self.revlog_kind == KIND_CHANGELOG: 463 if b'changelogv2' in opts and self.revlog_kind == KIND_CHANGELOG:
463 new_header = REVLOGV2 464 new_header = CHANGELOGV2
464 elif b'revlogv2' in opts: 465 elif b'revlogv2' in opts:
465 new_header = REVLOGV2 466 new_header = REVLOGV2
466 elif b'revlogv1' in opts: 467 elif b'revlogv1' in opts:
467 new_header = REVLOGV1 | FLAG_INLINE_DATA 468 new_header = REVLOGV1 | FLAG_INLINE_DATA
468 if b'generaldelta' in opts: 469 if b'generaldelta' in opts:
647 648
648 self._parse_index = parse_index_v1 649 self._parse_index = parse_index_v1
649 if self._format_version == REVLOGV0: 650 if self._format_version == REVLOGV0:
650 self._parse_index = revlogv0.parse_index_v0 651 self._parse_index = revlogv0.parse_index_v0
651 elif self._format_version == REVLOGV2: 652 elif self._format_version == REVLOGV2:
653 self._parse_index = parse_index_v2
654 elif self._format_version == CHANGELOGV2:
652 self._parse_index = parse_index_v2 655 self._parse_index = parse_index_v2
653 elif devel_nodemap: 656 elif devel_nodemap:
654 self._parse_index = parse_index_v1_nodemap 657 self._parse_index = parse_index_v1_nodemap
655 elif use_rust_index: 658 elif use_rust_index:
656 self._parse_index = parse_index_v1_mixed 659 self._parse_index = parse_index_v1_mixed