comparison mercurial/revlog.py @ 47077:119790e1c67c

cg4: introduce protocol flag to signify the presence of sidedata We need a way of signaling whether the current revision has sidedata or not, and re-using the revision flags would waste potential revlog flags and mix two normally independent layers. In this change, we add a single byte at the start of the ch4 delta header to set potential protocol flags. We also reclaim the revlog flag for sidedata, since it is no longer used, in its place now lives the (also experimental) copytracing flag. When generating deltas, apply the `CG_FLAG_SIDEDATA` flag if there is sidedata. When applying the deltas, if said flag is present, the next chunk contains the sidedata. Differential Revision: https://phab.mercurial-scm.org/D10343
author Rapha?l Gom?s <rgomes@octobus.net>
date Sat, 10 Apr 2021 11:27:40 +0200
parents 5554aacd783f
children 223b47235d1c
comparison
equal deleted inserted replaced
47076:08e26ef4ad35 47077:119790e1c67c
53 REVIDX_EXTSTORED, 53 REVIDX_EXTSTORED,
54 REVIDX_FLAGS_ORDER, 54 REVIDX_FLAGS_ORDER,
55 REVIDX_HASCOPIESINFO, 55 REVIDX_HASCOPIESINFO,
56 REVIDX_ISCENSORED, 56 REVIDX_ISCENSORED,
57 REVIDX_RAWTEXT_CHANGING_FLAGS, 57 REVIDX_RAWTEXT_CHANGING_FLAGS,
58 REVIDX_SIDEDATA,
59 ) 58 )
60 from .thirdparty import attr 59 from .thirdparty import attr
61 from . import ( 60 from . import (
62 ancestor, 61 ancestor,
63 dagop, 62 dagop,
96 REVLOG_DEFAULT_VERSION 95 REVLOG_DEFAULT_VERSION
97 REVLOGV1_FLAGS 96 REVLOGV1_FLAGS
98 REVLOGV2_FLAGS 97 REVLOGV2_FLAGS
99 REVIDX_ISCENSORED 98 REVIDX_ISCENSORED
100 REVIDX_ELLIPSIS 99 REVIDX_ELLIPSIS
101 REVIDX_SIDEDATA
102 REVIDX_HASCOPIESINFO 100 REVIDX_HASCOPIESINFO
103 REVIDX_EXTSTORED 101 REVIDX_EXTSTORED
104 REVIDX_DEFAULT_FLAGS 102 REVIDX_DEFAULT_FLAGS
105 REVIDX_FLAGS_ORDER 103 REVIDX_FLAGS_ORDER
106 REVIDX_RAWTEXT_CHANGING_FLAGS 104 REVIDX_RAWTEXT_CHANGING_FLAGS
194 flags = attr.ib() 192 flags = attr.ib()
195 baserevisionsize = attr.ib() 193 baserevisionsize = attr.ib()
196 revision = attr.ib() 194 revision = attr.ib()
197 delta = attr.ib() 195 delta = attr.ib()
198 sidedata = attr.ib() 196 sidedata = attr.ib()
197 protocol_flags = attr.ib()
199 linknode = attr.ib(default=None) 198 linknode = attr.ib(default=None)
200 199
201 200
202 @interfaceutil.implementer(repository.iverifyproblem) 201 @interfaceutil.implementer(repository.iverifyproblem)
203 @attr.s(frozen=True) 202 @attr.s(frozen=True)