comparison mercurial/upgrade.py @ 46205:53d083fa1f83

upgrade: rename finddeficiences() to find_format_upgrades() It was not obvious what does deficieny means and every format upgrade can't be a deficiency. There are some format upgrades like compression levels, share-safe which can't be understood at deficiencies. A change can be an upgrade or downgrade, however this `finddeficiences()` only used to find upgrades. This patch renames the function and related variables to make things more clearer. The ui message also got improved which is a good thing. Next patch will rename deficiency in general across the upgrade code. Differential Revision: https://phab.mercurial-scm.org/D9582
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 14 Dec 2020 16:03:15 +0530
parents 25d11b24dedf
children e2139e071b5c
comparison
equal deleted inserted replaced
46204:36c05ab02232 46205:53d083fa1f83
95 _(b'unknown optimization action requested: %s') 95 _(b'unknown optimization action requested: %s')
96 % b', '.join(sorted(optimize)), 96 % b', '.join(sorted(optimize)),
97 hint=_(b'run without arguments to see valid optimizations'), 97 hint=_(b'run without arguments to see valid optimizations'),
98 ) 98 )
99 99
100 deficiencies = upgrade_actions.finddeficiencies(repo) 100 format_upgrades = upgrade_actions.find_format_upgrades(repo)
101 actions = upgrade_actions.determineactions( 101 actions = upgrade_actions.determineactions(
102 repo, deficiencies, repo.requirements, newreqs 102 repo, format_upgrades, repo.requirements, newreqs
103 ) 103 )
104 actions.extend( 104 actions.extend(
105 o 105 o
106 for o in sorted(optimizations) 106 for o in sorted(optimizations)
107 # determineactions could have added optimisation 107 # determineactions could have added optimisation
133 133
134 if not run: 134 if not run:
135 fromconfig = [] 135 fromconfig = []
136 onlydefault = [] 136 onlydefault = []
137 137
138 for d in deficiencies: 138 for d in format_upgrades:
139 if d.fromconfig(repo): 139 if d.fromconfig(repo):
140 fromconfig.append(d) 140 fromconfig.append(d)
141 elif d.default: 141 elif d.default:
142 onlydefault.append(d) 142 onlydefault.append(d)
143 143
163 for i in onlydefault: 163 for i in onlydefault:
164 ui.status(b'%s\n %s\n\n' % (i.name, i.description)) 164 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
165 165
166 ui.status(b'\n') 166 ui.status(b'\n')
167 else: 167 else:
168 ui.status( 168 ui.status(_(b'(no format upgrades found in existing repository)\n'))
169 _(
170 b'(no feature deficiencies found in existing '
171 b'repository)\n'
172 )
173 )
174 169
175 ui.status( 170 ui.status(
176 _( 171 _(
177 b'performing an upgrade with "--run" will make the following ' 172 b'performing an upgrade with "--run" will make the following '
178 b'changes:\n\n' 173 b'changes:\n\n'