comparison mercurial/upgrade_utils/actions.py @ 48793:6e559391f96e

tracked-key: remove the dual write and rename to tracked-hint The dual-write approach was mostly useless. As explained in the previous version of the help, the key had to be read twice before we could cache a value. However this "read twice" limitation actually also apply to any usage of the key. If some operation wants to rely of the "same value == same tracked set" property it would need to read the value before, and after running that operation (or at least, after, in all cases). So it cannot be sure the operation it did is "valid" until checking the key after the operation. As a resultat such operation can only be read-only or rollbackable. This reduce the utility of the "same value == same tracked set" a lot. So it seems simpler to drop the double write and to update the documentation to highlight that this file does not garantee race-free operation. As a result the "key" is demoted to a "hint". Documentation is updated accordingly. Differential Revision: https://phab.mercurial-scm.org/D12201
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 17 Feb 2022 07:34:49 +0100
parents 5ba24e886cec
children 6000f5b25c9b
comparison
equal deleted inserted replaced
48792:8bbb1abb9d19 48793:6e559391f96e
199 compatible_with_share = True 199 compatible_with_share = True
200 200
201 201
202 @registerformatvariant 202 @registerformatvariant
203 class dirstatetrackedkey(requirementformatvariant): 203 class dirstatetrackedkey(requirementformatvariant):
204 name = b'tracked-key' 204 name = b'tracked-hint'
205 _requirement = requirements.DIRSTATE_TRACKED_KEY_V1 205 _requirement = requirements.DIRSTATE_TRACKED_HINT_V1
206 206
207 default = False 207 default = False
208 208
209 description = _( 209 description = _(
210 b'Add a small file to help external tooling that watch the tracked set' 210 b'Add a small file to help external tooling that watch the tracked set'
988 requirements.NODEMAP_REQUIREMENT, 988 requirements.NODEMAP_REQUIREMENT,
989 requirements.SHARESAFE_REQUIREMENT, 989 requirements.SHARESAFE_REQUIREMENT,
990 requirements.REVLOGV2_REQUIREMENT, 990 requirements.REVLOGV2_REQUIREMENT,
991 requirements.CHANGELOGV2_REQUIREMENT, 991 requirements.CHANGELOGV2_REQUIREMENT,
992 requirements.REVLOGV1_REQUIREMENT, 992 requirements.REVLOGV1_REQUIREMENT,
993 requirements.DIRSTATE_TRACKED_KEY_V1, 993 requirements.DIRSTATE_TRACKED_HINT_V1,
994 requirements.DIRSTATE_V2_REQUIREMENT, 994 requirements.DIRSTATE_V2_REQUIREMENT,
995 } 995 }
996 for name in compression.compengines: 996 for name in compression.compengines:
997 engine = compression.compengines[name] 997 engine = compression.compengines[name]
998 if engine.available() and engine.revlogheader(): 998 if engine.available() and engine.revlogheader():
1011 Extensions should monkeypatch this to add their custom requirements. 1011 Extensions should monkeypatch this to add their custom requirements.
1012 """ 1012 """
1013 supported = { 1013 supported = {
1014 requirements.CHANGELOGV2_REQUIREMENT, 1014 requirements.CHANGELOGV2_REQUIREMENT,
1015 requirements.COPIESSDC_REQUIREMENT, 1015 requirements.COPIESSDC_REQUIREMENT,
1016 requirements.DIRSTATE_TRACKED_KEY_V1, 1016 requirements.DIRSTATE_TRACKED_HINT_V1,
1017 requirements.DIRSTATE_V2_REQUIREMENT, 1017 requirements.DIRSTATE_V2_REQUIREMENT,
1018 requirements.DOTENCODE_REQUIREMENT, 1018 requirements.DOTENCODE_REQUIREMENT,
1019 requirements.FNCACHE_REQUIREMENT, 1019 requirements.FNCACHE_REQUIREMENT,
1020 requirements.GENERALDELTA_REQUIREMENT, 1020 requirements.GENERALDELTA_REQUIREMENT,
1021 requirements.NODEMAP_REQUIREMENT, 1021 requirements.NODEMAP_REQUIREMENT,
1054 requirements.NODEMAP_REQUIREMENT, 1054 requirements.NODEMAP_REQUIREMENT,
1055 requirements.SHARESAFE_REQUIREMENT, 1055 requirements.SHARESAFE_REQUIREMENT,
1056 requirements.REVLOGV1_REQUIREMENT, 1056 requirements.REVLOGV1_REQUIREMENT,
1057 requirements.REVLOGV2_REQUIREMENT, 1057 requirements.REVLOGV2_REQUIREMENT,
1058 requirements.CHANGELOGV2_REQUIREMENT, 1058 requirements.CHANGELOGV2_REQUIREMENT,
1059 requirements.DIRSTATE_TRACKED_KEY_V1, 1059 requirements.DIRSTATE_TRACKED_HINT_V1,
1060 requirements.DIRSTATE_V2_REQUIREMENT, 1060 requirements.DIRSTATE_V2_REQUIREMENT,
1061 } 1061 }
1062 for name in compression.compengines: 1062 for name in compression.compengines:
1063 engine = compression.compengines[name] 1063 engine = compression.compengines[name]
1064 if engine.available() and engine.revlogheader(): 1064 if engine.available() and engine.revlogheader():