##// END OF EJS Templates
changelogv2: use a dedicated version number...
marmoute -
r48040:921648d3 default
parent child Browse files
Show More
@@ -35,6 +35,7 b' from .i18n import _'
35 35 from .pycompat import getattr
36 36 from .revlogutils.constants import (
37 37 ALL_KINDS,
38 CHANGELOGV2,
38 39 COMP_MODE_DEFAULT,
39 40 COMP_MODE_INLINE,
40 41 COMP_MODE_PLAIN,
@@ -460,7 +461,7 b' class revlog(object):'
460 461 opts = self.opener.options
461 462
462 463 if b'changelogv2' in opts and self.revlog_kind == KIND_CHANGELOG:
463 new_header = REVLOGV2
464 new_header = CHANGELOGV2
464 465 elif b'revlogv2' in opts:
465 466 new_header = REVLOGV2
466 467 elif b'revlogv1' in opts:
@@ -650,6 +651,8 b' class revlog(object):'
650 651 self._parse_index = revlogv0.parse_index_v0
651 652 elif self._format_version == REVLOGV2:
652 653 self._parse_index = parse_index_v2
654 elif self._format_version == CHANGELOGV2:
655 self._parse_index = parse_index_v2
653 656 elif devel_nodemap:
654 657 self._parse_index = parse_index_v1_nodemap
655 658 elif use_rust_index:
@@ -36,6 +36,8 b' REVLOGV0 = 0'
36 36 REVLOGV1 = 1
37 37 # Dummy value until file format is finalized.
38 38 REVLOGV2 = 0xDEAD
39 # Dummy value until file format is finalized.
40 CHANGELOGV2 = 0xD34D
39 41
40 42 ## global revlog header flags
41 43 # Shared across v1 and v2.
@@ -48,6 +50,7 b' REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_'
48 50 REVLOGV0_FLAGS = 0
49 51 REVLOGV1_FLAGS = FLAG_INLINE_DATA | FLAG_GENERALDELTA
50 52 REVLOGV2_FLAGS = FLAG_INLINE_DATA
53 CHANGELOGV2_FLAGS = 0
51 54
52 55 ### individual entry
53 56
@@ -141,6 +144,7 b' SUPPORTED_FLAGS = {'
141 144 REVLOGV0: REVLOGV0_FLAGS,
142 145 REVLOGV1: REVLOGV1_FLAGS,
143 146 REVLOGV2: REVLOGV2_FLAGS,
147 CHANGELOGV2: CHANGELOGV2_FLAGS,
144 148 }
145 149
146 150 _no = lambda flags: False
@@ -173,6 +177,13 b' FEATURES_BY_VERSION = {'
173 177 b'sidedata': True,
174 178 b'docket': True,
175 179 },
180 CHANGELOGV2: {
181 b'inline': _no,
182 # General delta is useless for changelog since we don't do any delta
183 b'generaldelta': _no,
184 b'sidedata': True,
185 b'docket': True,
186 },
176 187 }
177 188
178 189
@@ -145,7 +145,8 b' class RevlogDocket(object):'
145 145
146 146 def default_docket(revlog, version_header):
147 147 """given a revlog version a new docket object for the given revlog"""
148 if (version_header & 0xFFFF) != constants.REVLOGV2:
148 rl_version = version_header & 0xFFFF
149 if rl_version not in (constants.REVLOGV2, constants.CHANGELOGV2):
149 150 return None
150 151 comp = util.compengines[revlog._compengine].revlogheader()
151 152 docket = RevlogDocket(
General Comments 0
You need to be logged in to leave comments. Login now