Mercurial > public > mercurial-scm > hg
comparison mercurial/upgrade.py @ 46189:dfddcbb0c244
upgrade: move `printupgradeactions()` to UpgradeOperation class
Part of refactor where we make things more arranged and integrated into single
`UpgradeOperation` class.
Differential Revision: https://phab.mercurial-scm.org/D9575
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 12 Dec 2020 17:54:59 +0530 |
parents | 945b33a7edfd |
children | 9ab2ab5bf9af |
comparison
equal
deleted
inserted
replaced
46188:945b33a7edfd | 46189:dfddcbb0c244 |
---|---|
161 [a.name for a in optimisations], | 161 [a.name for a in optimisations], |
162 "upgrade-repo.optimisation.performed", | 162 "upgrade-repo.optimisation.performed", |
163 ) | 163 ) |
164 ui.write(b'\n\n') | 164 ui.write(b'\n\n') |
165 | 165 |
166 def printupgradeactions(): | |
167 for a in actions: | |
168 ui.status(b'%s\n %s\n\n' % (a.name, a.upgrademessage)) | |
169 | |
170 upgrade_op = upgrade_actions.UpgradeOperation( | 166 upgrade_op = upgrade_actions.UpgradeOperation( |
171 ui, | 167 ui, |
172 newreqs, | 168 newreqs, |
173 [a.name for a in actions], | 169 actions, |
174 revlogs, | 170 revlogs, |
175 ) | 171 ) |
176 | 172 |
177 if not run: | 173 if not run: |
178 fromconfig = [] | 174 fromconfig = [] |
222 ) | 218 ) |
223 ) | 219 ) |
224 | 220 |
225 printrequirements() | 221 printrequirements() |
226 printoptimisations() | 222 printoptimisations() |
227 printupgradeactions() | 223 upgrade_op.print_upgrade_actions() |
228 upgrade_op.print_affected_revlogs() | 224 upgrade_op.print_affected_revlogs() |
229 | 225 |
230 unusedoptimize = [i for i in alloptimizations if i not in actions] | 226 unusedoptimize = [i for i in alloptimizations if i not in actions] |
231 | 227 |
232 if unusedoptimize: | 228 if unusedoptimize: |
242 | 238 |
243 # Else we're in the run=true case. | 239 # Else we're in the run=true case. |
244 ui.write(_(b'upgrade will perform the following actions:\n\n')) | 240 ui.write(_(b'upgrade will perform the following actions:\n\n')) |
245 printrequirements() | 241 printrequirements() |
246 printoptimisations() | 242 printoptimisations() |
247 printupgradeactions() | 243 upgrade_op.print_upgrade_actions() |
248 upgrade_op.print_affected_revlogs() | 244 upgrade_op.print_affected_revlogs() |
249 | 245 |
250 ui.status(_(b'beginning upgrade...\n')) | 246 ui.status(_(b'beginning upgrade...\n')) |
251 with repo.wlock(), repo.lock(): | 247 with repo.wlock(), repo.lock(): |
252 ui.status(_(b'repository locked and read-only\n')) | 248 ui.status(_(b'repository locked and read-only\n')) |