Mercurial > public > mercurial-scm > hg
comparison mercurial/revlogutils/constants.py @ 47395:a669404f0f4a
revlog: add a function to build index entry tuple
Keeping index entry as tuple make sense for performance reason, however it does
not means we need to manually build that tuple for all piece of python code that
are not performance critical.
So we add a nice function responsible to build the tuple using argument using
explicit keyword argument.
Differential Revision: https://phab.mercurial-scm.org/D10793
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 30 May 2021 17:10:56 +0200 |
parents | 7a0ec25d5836 |
children | 2c6084f67a86 |
comparison
equal
deleted
inserted
replaced
47394:ac60a1366a49 | 47395:a669404f0f4a |
---|---|
10 from __future__ import absolute_import | 10 from __future__ import absolute_import |
11 | 11 |
12 import struct | 12 import struct |
13 | 13 |
14 from ..interfaces import repository | 14 from ..interfaces import repository |
15 from .. import revlogutils | |
15 | 16 |
16 ### Internal utily constants | 17 ### Internal utily constants |
17 | 18 |
18 KIND_CHANGELOG = 1001 # over 256 to not be comparable with a bytes | 19 KIND_CHANGELOG = 1001 # over 256 to not be comparable with a bytes |
19 KIND_MANIFESTLOG = 1002 | 20 KIND_MANIFESTLOG = 1002 |
227 # revlog v2, disallowing INLINE mode. | 228 # revlog v2, disallowing INLINE mode. |
228 COMP_MODE_DEFAULT = 1 | 229 COMP_MODE_DEFAULT = 1 |
229 | 230 |
230 # Chunk use a compression mode stored "inline" at the start of the chunk | 231 # Chunk use a compression mode stored "inline" at the start of the chunk |
231 # itself. This is the mode always used for revlog version "0" and "1" | 232 # itself. This is the mode always used for revlog version "0" and "1" |
232 COMP_MODE_INLINE = 2 | 233 COMP_MODE_INLINE = revlogutils.COMP_MODE_INLINE |
233 | 234 |
234 SUPPORTED_FLAGS = { | 235 SUPPORTED_FLAGS = { |
235 REVLOGV0: REVLOGV0_FLAGS, | 236 REVLOGV0: REVLOGV0_FLAGS, |
236 REVLOGV1: REVLOGV1_FLAGS, | 237 REVLOGV1: REVLOGV1_FLAGS, |
237 REVLOGV2: REVLOGV2_FLAGS, | 238 REVLOGV2: REVLOGV2_FLAGS, |