Mercurial > public > mercurial-scm > hg-stable
diff 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 |
line wrap: on
line diff
--- a/mercurial/upgrade_utils/actions.py Tue Dec 29 10:53:45 2020 +0100 +++ b/mercurial/upgrade_utils/actions.py Sat Dec 12 17:51:27 2020 +0530 @@ -557,11 +557,21 @@ class UpgradeOperation(object): """represent the work to be done during an upgrade""" - def __init__(self, requirements, actions, revlogs_to_process): + def __init__(self, ui, requirements, actions, revlogs_to_process): + self.ui = ui self.requirements = requirements self.actions = actions self.revlogs_to_process = revlogs_to_process + def print_affected_revlogs(self): + if not self.revlogs_to_process: + self.ui.write((b'no revlogs to process\n')) + else: + self.ui.write((b'processed revlogs:\n')) + for r in sorted(self.revlogs_to_process): + self.ui.write((b' - %s\n' % r)) + self.ui.write((b'\n')) + ### Code checking if a repository can got through the upgrade process at all. #