Show More
@@ -163,14 +163,10 b' def upgraderepo(' | |||
|
163 | 163 | ) |
|
164 | 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 | 166 | upgrade_op = upgrade_actions.UpgradeOperation( |
|
171 | 167 | ui, |
|
172 | 168 | newreqs, |
|
173 |
|
|
|
169 | actions, | |
|
174 | 170 | revlogs, |
|
175 | 171 | ) |
|
176 | 172 | |
@@ -224,7 +220,7 b' def upgraderepo(' | |||
|
224 | 220 | |
|
225 | 221 | printrequirements() |
|
226 | 222 | printoptimisations() |
|
227 | printupgradeactions() | |
|
223 | upgrade_op.print_upgrade_actions() | |
|
228 | 224 | upgrade_op.print_affected_revlogs() |
|
229 | 225 | |
|
230 | 226 | unusedoptimize = [i for i in alloptimizations if i not in actions] |
@@ -244,7 +240,7 b' def upgraderepo(' | |||
|
244 | 240 | ui.write(_(b'upgrade will perform the following actions:\n\n')) |
|
245 | 241 | printrequirements() |
|
246 | 242 | printoptimisations() |
|
247 | printupgradeactions() | |
|
243 | upgrade_op.print_upgrade_actions() | |
|
248 | 244 | upgrade_op.print_affected_revlogs() |
|
249 | 245 | |
|
250 | 246 | ui.status(_(b'beginning upgrade...\n')) |
@@ -561,8 +561,13 b' class UpgradeOperation(object):' | |||
|
561 | 561 | self.ui = ui |
|
562 | 562 | self.requirements = requirements |
|
563 | 563 | self.actions = actions |
|
564 | self._actions_names = set([a.name for a in actions]) | |
|
564 | 565 | self.revlogs_to_process = revlogs_to_process |
|
565 | 566 | |
|
567 | def print_upgrade_actions(self): | |
|
568 | for a in self.actions: | |
|
569 | self.ui.status(b'%s\n %s\n\n' % (a.name, a.upgrademessage)) | |
|
570 | ||
|
566 | 571 | def print_affected_revlogs(self): |
|
567 | 572 | if not self.revlogs_to_process: |
|
568 | 573 | self.ui.write((b'no revlogs to process\n')) |
@@ -572,6 +577,10 b' class UpgradeOperation(object):' | |||
|
572 | 577 | self.ui.write((b' - %s\n' % r)) |
|
573 | 578 | self.ui.write((b'\n')) |
|
574 | 579 | |
|
580 | def has_action(self, name): | |
|
581 | """ Check whether the upgrade operation will perform this action """ | |
|
582 | return name in self._actions_names | |
|
583 | ||
|
575 | 584 | |
|
576 | 585 | ### Code checking if a repository can got through the upgrade process at all. # |
|
577 | 586 |
@@ -403,13 +403,13 b' def upgrade(ui, srcrepo, dstrepo, upgrad' | |||
|
403 | 403 | ) |
|
404 | 404 | ) |
|
405 | 405 | |
|
406 | if b're-delta-all' in upgrade_op.actions: | |
|
406 | if upgrade_op.has_action(b're-delta-all'): | |
|
407 | 407 | deltareuse = revlog.revlog.DELTAREUSENEVER |
|
408 | elif b're-delta-parent' in upgrade_op.actions: | |
|
408 | elif upgrade_op.has_action(b're-delta-parent'): | |
|
409 | 409 | deltareuse = revlog.revlog.DELTAREUSESAMEREVS |
|
410 | elif b're-delta-multibase' in upgrade_op.actions: | |
|
410 | elif upgrade_op.has_action(b're-delta-multibase'): | |
|
411 | 411 | deltareuse = revlog.revlog.DELTAREUSESAMEREVS |
|
412 | elif b're-delta-fulladd' in upgrade_op.actions: | |
|
412 | elif upgrade_op.has_action(b're-delta-fulladd'): | |
|
413 | 413 | deltareuse = revlog.revlog.DELTAREUSEFULLADD |
|
414 | 414 | else: |
|
415 | 415 | deltareuse = revlog.revlog.DELTAREUSEALWAYS |
@@ -421,7 +421,7 b' def upgrade(ui, srcrepo, dstrepo, upgrad' | |||
|
421 | 421 | dstrepo, |
|
422 | 422 | tr, |
|
423 | 423 | deltareuse, |
|
424 |
b're-delta-multibase' |
|
|
424 | upgrade_op.has_action(b're-delta-multibase'), | |
|
425 | 425 | revlogs=upgrade_op.revlogs_to_process, |
|
426 | 426 | ) |
|
427 | 427 |
General Comments 0
You need to be logged in to leave comments.
Login now