Mercurial > public > mercurial-scm > hg
comparison mercurial/revlogutils/constants.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 | 4c041c71ec01 |
children | 0e9105bf54cb |
comparison
equal
deleted
inserted
replaced
47076:08e26ef4ad35 | 47077:119790e1c67c |
---|---|
97 REVIDX_ISCENSORED = repository.REVISION_FLAG_CENSORED | 97 REVIDX_ISCENSORED = repository.REVISION_FLAG_CENSORED |
98 # revision hash does not match data (narrowhg) | 98 # revision hash does not match data (narrowhg) |
99 REVIDX_ELLIPSIS = repository.REVISION_FLAG_ELLIPSIS | 99 REVIDX_ELLIPSIS = repository.REVISION_FLAG_ELLIPSIS |
100 # revision data is stored externally | 100 # revision data is stored externally |
101 REVIDX_EXTSTORED = repository.REVISION_FLAG_EXTSTORED | 101 REVIDX_EXTSTORED = repository.REVISION_FLAG_EXTSTORED |
102 # revision data contains extra metadata not part of the official digest | |
103 REVIDX_SIDEDATA = repository.REVISION_FLAG_SIDEDATA | |
104 # revision changes files in a way that could affect copy tracing. | 102 # revision changes files in a way that could affect copy tracing. |
105 REVIDX_HASCOPIESINFO = repository.REVISION_FLAG_HASCOPIESINFO | 103 REVIDX_HASCOPIESINFO = repository.REVISION_FLAG_HASCOPIESINFO |
106 REVIDX_DEFAULT_FLAGS = 0 | 104 REVIDX_DEFAULT_FLAGS = 0 |
107 # stable order in which flags need to be processed and their processors applied | 105 # stable order in which flags need to be processed and their processors applied |
108 REVIDX_FLAGS_ORDER = [ | 106 REVIDX_FLAGS_ORDER = [ |
109 REVIDX_ISCENSORED, | 107 REVIDX_ISCENSORED, |
110 REVIDX_ELLIPSIS, | 108 REVIDX_ELLIPSIS, |
111 REVIDX_EXTSTORED, | 109 REVIDX_EXTSTORED, |
112 REVIDX_SIDEDATA, | |
113 REVIDX_HASCOPIESINFO, | 110 REVIDX_HASCOPIESINFO, |
114 ] | 111 ] |
115 | 112 |
116 # bitmark for flags that could cause rawdata content change | 113 # bitmark for flags that could cause rawdata content change |
117 REVIDX_RAWTEXT_CHANGING_FLAGS = ( | 114 REVIDX_RAWTEXT_CHANGING_FLAGS = REVIDX_ISCENSORED | REVIDX_EXTSTORED |
118 REVIDX_ISCENSORED | REVIDX_EXTSTORED | REVIDX_SIDEDATA | |
119 ) | |
120 | 115 |
121 SPARSE_REVLOG_MAX_CHAIN_LENGTH = 1000 | 116 SPARSE_REVLOG_MAX_CHAIN_LENGTH = 1000 |