Mercurial > public > mercurial-scm > hg
comparison mercurial/upgrade_utils/actions.py @ 46192:25d11b24dedf
upgrade: move printing of unused optimizations to UpgradeOperation class
Differential Revision: https://phab.mercurial-scm.org/D9578
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 14 Dec 2020 13:48:25 +0530 |
parents | aba979b1b90b |
children | 53d083fa1f83 |
comparison
equal
deleted
inserted
replaced
46191:aba979b1b90b | 46192:25d11b24dedf |
---|---|
581 ) | 581 ) |
582 # requirements which will be preserved by the operation | 582 # requirements which will be preserved by the operation |
583 self._preserved_requirements = ( | 583 self._preserved_requirements = ( |
584 self.current_requirements & self.new_requirements | 584 self.current_requirements & self.new_requirements |
585 ) | 585 ) |
586 # optimizations which are not used and it's recommended that they | |
587 # should use them | |
588 all_optimizations = findoptimizations(None) | |
589 self.unused_optimizations = [ | |
590 i for i in all_optimizations if i not in self.actions | |
591 ] | |
586 | 592 |
587 def _write_labeled(self, l, label): | 593 def _write_labeled(self, l, label): |
588 """ | 594 """ |
589 Utility function to aid writing of a list under one label | 595 Utility function to aid writing of a list under one label |
590 """ | 596 """ |
637 else: | 643 else: |
638 self.ui.write((b'processed revlogs:\n')) | 644 self.ui.write((b'processed revlogs:\n')) |
639 for r in sorted(self.revlogs_to_process): | 645 for r in sorted(self.revlogs_to_process): |
640 self.ui.write((b' - %s\n' % r)) | 646 self.ui.write((b' - %s\n' % r)) |
641 self.ui.write((b'\n')) | 647 self.ui.write((b'\n')) |
648 | |
649 def print_unused_optimizations(self): | |
650 for i in self.unused_optimizations: | |
651 self.ui.status(_(b'%s\n %s\n\n') % (i.name, i.description)) | |
642 | 652 |
643 def has_action(self, name): | 653 def has_action(self, name): |
644 """ Check whether the upgrade operation will perform this action """ | 654 """ Check whether the upgrade operation will perform this action """ |
645 return name in self._actions_names | 655 return name in self._actions_names |
646 | 656 |