Show More
@@ -35,6 +35,7 b' 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, | |
@@ -460,7 +461,7 b' class revlog(object):' | |||||
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 = |
|
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: | |
@@ -650,6 +651,8 b' class revlog(object):' | |||||
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: | |
652 | self._parse_index = parse_index_v2 |
|
653 | self._parse_index = parse_index_v2 | |
|
654 | elif self._format_version == CHANGELOGV2: | |||
|
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: |
@@ -36,6 +36,8 b' REVLOGV0 = 0' | |||||
36 | REVLOGV1 = 1 |
|
36 | REVLOGV1 = 1 | |
37 | # Dummy value until file format is finalized. |
|
37 | # Dummy value until file format is finalized. | |
38 | REVLOGV2 = 0xDEAD |
|
38 | REVLOGV2 = 0xDEAD | |
|
39 | # Dummy value until file format is finalized. | |||
|
40 | CHANGELOGV2 = 0xD34D | |||
39 |
|
41 | |||
40 | ## global revlog header flags |
|
42 | ## global revlog header flags | |
41 | # Shared across v1 and v2. |
|
43 | # Shared across v1 and v2. | |
@@ -48,6 +50,7 b' REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_' | |||||
48 | REVLOGV0_FLAGS = 0 |
|
50 | REVLOGV0_FLAGS = 0 | |
49 | REVLOGV1_FLAGS = FLAG_INLINE_DATA | FLAG_GENERALDELTA |
|
51 | REVLOGV1_FLAGS = FLAG_INLINE_DATA | FLAG_GENERALDELTA | |
50 | REVLOGV2_FLAGS = FLAG_INLINE_DATA |
|
52 | REVLOGV2_FLAGS = FLAG_INLINE_DATA | |
|
53 | CHANGELOGV2_FLAGS = 0 | |||
51 |
|
54 | |||
52 | ### individual entry |
|
55 | ### individual entry | |
53 |
|
56 | |||
@@ -141,6 +144,7 b' SUPPORTED_FLAGS = {' | |||||
141 | REVLOGV0: REVLOGV0_FLAGS, |
|
144 | REVLOGV0: REVLOGV0_FLAGS, | |
142 | REVLOGV1: REVLOGV1_FLAGS, |
|
145 | REVLOGV1: REVLOGV1_FLAGS, | |
143 | REVLOGV2: REVLOGV2_FLAGS, |
|
146 | REVLOGV2: REVLOGV2_FLAGS, | |
|
147 | CHANGELOGV2: CHANGELOGV2_FLAGS, | |||
144 | } |
|
148 | } | |
145 |
|
149 | |||
146 | _no = lambda flags: False |
|
150 | _no = lambda flags: False | |
@@ -173,6 +177,13 b' FEATURES_BY_VERSION = {' | |||||
173 | b'sidedata': True, |
|
177 | b'sidedata': True, | |
174 | b'docket': True, |
|
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 | def default_docket(revlog, version_header): |
|
146 | def default_docket(revlog, version_header): | |
147 | """given a revlog version a new docket object for the given revlog""" |
|
147 | """given a revlog version a new docket object for the given revlog""" | |
148 |
|
|
148 | rl_version = version_header & 0xFFFF | |
|
149 | if rl_version not in (constants.REVLOGV2, constants.CHANGELOGV2): | |||
149 | return None |
|
150 | return None | |
150 | comp = util.compengines[revlog._compengine].revlogheader() |
|
151 | comp = util.compengines[revlog._compengine].revlogheader() | |
151 | docket = RevlogDocket( |
|
152 | docket = RevlogDocket( |
General Comments 0
You need to be logged in to leave comments.
Login now