Mercurial > public > mercurial-scm > hg
comparison mercurial/upgrade_utils/actions.py @ 46188:945b33a7edfd
upgrade: move `print_affected_revlogs()` 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/D9574
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 12 Dec 2020 17:51:27 +0530 |
parents | c407513a44a3 |
children | dfddcbb0c244 |
comparison
equal
deleted
inserted
replaced
46187:95d6f31e88db | 46188:945b33a7edfd |
---|---|
555 | 555 |
556 | 556 |
557 class UpgradeOperation(object): | 557 class UpgradeOperation(object): |
558 """represent the work to be done during an upgrade""" | 558 """represent the work to be done during an upgrade""" |
559 | 559 |
560 def __init__(self, requirements, actions, revlogs_to_process): | 560 def __init__(self, ui, requirements, actions, revlogs_to_process): |
561 self.ui = ui | |
561 self.requirements = requirements | 562 self.requirements = requirements |
562 self.actions = actions | 563 self.actions = actions |
563 self.revlogs_to_process = revlogs_to_process | 564 self.revlogs_to_process = revlogs_to_process |
565 | |
566 def print_affected_revlogs(self): | |
567 if not self.revlogs_to_process: | |
568 self.ui.write((b'no revlogs to process\n')) | |
569 else: | |
570 self.ui.write((b'processed revlogs:\n')) | |
571 for r in sorted(self.revlogs_to_process): | |
572 self.ui.write((b' - %s\n' % r)) | |
573 self.ui.write((b'\n')) | |
564 | 574 |
565 | 575 |
566 ### Code checking if a repository can got through the upgrade process at all. # | 576 ### Code checking if a repository can got through the upgrade process at all. # |
567 | 577 |
568 | 578 |