comparison mercurial/upgrade_utils/actions.py @ 48790:5ba24e886cec

tracked-key: make it possible to upgrade to and downgrade from the feature This seems rather important if we want people to start using it. Differential Revision: https://phab.mercurial-scm.org/D12198
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 17 Feb 2022 06:32:03 +0100
parents 6e77083683a7
children 6e559391f96e
comparison
equal deleted inserted replaced
48789:ef50a62eec40 48790:5ba24e886cec
188 b'Version 2 has a better structure,' 188 b'Version 2 has a better structure,'
189 b'better information and lighter update mechanism' 189 b'better information and lighter update mechanism'
190 ) 190 )
191 191
192 upgrademessage = _(b'"hg status" will be faster') 192 upgrademessage = _(b'"hg status" will be faster')
193
194 touches_filelogs = False
195 touches_manifests = False
196 touches_changelog = False
197 touches_requirements = True
198 touches_dirstate = True
199 compatible_with_share = True
200
201
202 @registerformatvariant
203 class dirstatetrackedkey(requirementformatvariant):
204 name = b'tracked-key'
205 _requirement = requirements.DIRSTATE_TRACKED_KEY_V1
206
207 default = False
208
209 description = _(
210 b'Add a small file to help external tooling that watch the tracked set'
211 )
212
213 upgrademessage = _(
214 b'external tools will be informated of potential change in the tracked set'
215 )
193 216
194 touches_filelogs = False 217 touches_filelogs = False
195 touches_manifests = False 218 touches_manifests = False
196 touches_changelog = False 219 touches_changelog = False
197 touches_requirements = True 220 touches_requirements = True
965 requirements.NODEMAP_REQUIREMENT, 988 requirements.NODEMAP_REQUIREMENT,
966 requirements.SHARESAFE_REQUIREMENT, 989 requirements.SHARESAFE_REQUIREMENT,
967 requirements.REVLOGV2_REQUIREMENT, 990 requirements.REVLOGV2_REQUIREMENT,
968 requirements.CHANGELOGV2_REQUIREMENT, 991 requirements.CHANGELOGV2_REQUIREMENT,
969 requirements.REVLOGV1_REQUIREMENT, 992 requirements.REVLOGV1_REQUIREMENT,
993 requirements.DIRSTATE_TRACKED_KEY_V1,
970 requirements.DIRSTATE_V2_REQUIREMENT, 994 requirements.DIRSTATE_V2_REQUIREMENT,
971 } 995 }
972 for name in compression.compengines: 996 for name in compression.compengines:
973 engine = compression.compengines[name] 997 engine = compression.compengines[name]
974 if engine.available() and engine.revlogheader(): 998 if engine.available() and engine.revlogheader():
987 Extensions should monkeypatch this to add their custom requirements. 1011 Extensions should monkeypatch this to add their custom requirements.
988 """ 1012 """
989 supported = { 1013 supported = {
990 requirements.CHANGELOGV2_REQUIREMENT, 1014 requirements.CHANGELOGV2_REQUIREMENT,
991 requirements.COPIESSDC_REQUIREMENT, 1015 requirements.COPIESSDC_REQUIREMENT,
1016 requirements.DIRSTATE_TRACKED_KEY_V1,
992 requirements.DIRSTATE_V2_REQUIREMENT, 1017 requirements.DIRSTATE_V2_REQUIREMENT,
993 requirements.DOTENCODE_REQUIREMENT, 1018 requirements.DOTENCODE_REQUIREMENT,
994 requirements.FNCACHE_REQUIREMENT, 1019 requirements.FNCACHE_REQUIREMENT,
995 requirements.GENERALDELTA_REQUIREMENT, 1020 requirements.GENERALDELTA_REQUIREMENT,
996 requirements.NODEMAP_REQUIREMENT, 1021 requirements.NODEMAP_REQUIREMENT,
1029 requirements.NODEMAP_REQUIREMENT, 1054 requirements.NODEMAP_REQUIREMENT,
1030 requirements.SHARESAFE_REQUIREMENT, 1055 requirements.SHARESAFE_REQUIREMENT,
1031 requirements.REVLOGV1_REQUIREMENT, 1056 requirements.REVLOGV1_REQUIREMENT,
1032 requirements.REVLOGV2_REQUIREMENT, 1057 requirements.REVLOGV2_REQUIREMENT,
1033 requirements.CHANGELOGV2_REQUIREMENT, 1058 requirements.CHANGELOGV2_REQUIREMENT,
1059 requirements.DIRSTATE_TRACKED_KEY_V1,
1034 requirements.DIRSTATE_V2_REQUIREMENT, 1060 requirements.DIRSTATE_V2_REQUIREMENT,
1035 } 1061 }
1036 for name in compression.compengines: 1062 for name in compression.compengines:
1037 engine = compression.compengines[name] 1063 engine = compression.compengines[name]
1038 if engine.available() and engine.revlogheader(): 1064 if engine.available() and engine.revlogheader():