comparison mercurial/upgrade_utils/actions.py @ 46206:9540945e51fd

actions: rename DEFICIENCY constant to FORMAT_VARIANT It was not obvious what does deficieny means and every format change can't be a deficiency. There are some format changes like compression levels, share-safe which can't be understood at deficiencies. This patch renames the constant to make things clearer. Differential Revision: https://phab.mercurial-scm.org/D9664
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 30 Dec 2020 14:56:34 +0530
parents 53d083fa1f83
children a51d345f1404
comparison
equal deleted inserted replaced
46205:53d083fa1f83 46206:9540945e51fd
26 26
27 def preservedrequirements(repo): 27 def preservedrequirements(repo):
28 return set() 28 return set()
29 29
30 30
31 DEFICIENCY = b'deficiency' 31 FORMAT_VARIANT = b'deficiency'
32 OPTIMISATION = b'optimization' 32 OPTIMISATION = b'optimization'
33 33
34 34
35 class improvement(object): 35 class improvement(object):
36 """Represents an improvement that can be made as part of an upgrade. 36 """Represents an improvement that can be made as part of an upgrade.
40 name 40 name
41 Machine-readable string uniquely identifying this improvement. It 41 Machine-readable string uniquely identifying this improvement. It
42 will be mapped to an action later in the upgrade process. 42 will be mapped to an action later in the upgrade process.
43 43
44 type 44 type
45 Either ``DEFICIENCY`` or ``OPTIMISATION``. A deficiency is an obvious 45 Either ``FORMAT_VARIANT`` or ``OPTIMISATION``.
46 problem. An optimization is an action (sometimes optional) that 46 A format variant is where we change the storage format. Not all format
47 variant changes are an obvious problem.
48 An optimization is an action (sometimes optional) that
47 can be taken to further improve the state of the repository. 49 can be taken to further improve the state of the repository.
48 50
49 description 51 description
50 Message intended for humans explaining the improvement in more detail, 52 Message intended for humans explaining the improvement in more detail,
51 including the implications of it. For ``DEFICIENCY`` types, should be 53 including the implications of it. For ``FORMAT_VARIANT`` types, should be
52 worded in the present tense. For ``OPTIMISATION`` types, should be 54 worded in the present tense. For ``OPTIMISATION`` types, should be
53 worded in the future tense. 55 worded in the future tense.
54 56
55 upgrademessage 57 upgrademessage
56 Message intended for humans explaining what an upgrade addressing this 58 Message intended for humans explaining what an upgrade addressing this
85 87
86 88
87 class formatvariant(improvement): 89 class formatvariant(improvement):
88 """an improvement subclass dedicated to repository format""" 90 """an improvement subclass dedicated to repository format"""
89 91
90 type = DEFICIENCY 92 type = FORMAT_VARIANT
91 ### The following attributes should be defined for each class: 93 ### The following attributes should be defined for each class:
92 94
93 # machine-readable string uniquely identifying this improvement. it will be 95 # machine-readable string uniquely identifying this improvement. it will be
94 # mapped to an action later in the upgrade process. 96 # mapped to an action later in the upgrade process.
95 name = None 97 name = None
96 98
97 # message intended for humans explaining the improvement in more detail, 99 # message intended for humans explaining the improvement in more detail,
98 # including the implications of it ``DEFICIENCY`` types, should be worded 100 # including the implications of it ``FORMAT_VARIANT`` types, should be
101 # worded
99 # in the present tense. 102 # in the present tense.
100 description = None 103 description = None
101 104
102 # message intended for humans explaining what an upgrade addressing this 105 # message intended for humans explaining what an upgrade addressing this
103 # issue will do. should be worded in the future tense. 106 # issue will do. should be worded in the future tense.