mercurial/upgrade_utils/actions.py
changeset 46189 dfddcbb0c244
parent 46188 945b33a7edfd
child 46190 9ab2ab5bf9af
equal deleted inserted replaced
46188:945b33a7edfd 46189:dfddcbb0c244
   559 
   559 
   560     def __init__(self, ui, requirements, actions, revlogs_to_process):
   560     def __init__(self, ui, requirements, actions, revlogs_to_process):
   561         self.ui = ui
   561         self.ui = ui
   562         self.requirements = requirements
   562         self.requirements = requirements
   563         self.actions = actions
   563         self.actions = actions
       
   564         self._actions_names = set([a.name for a in actions])
   564         self.revlogs_to_process = revlogs_to_process
   565         self.revlogs_to_process = revlogs_to_process
       
   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))
   565 
   570 
   566     def print_affected_revlogs(self):
   571     def print_affected_revlogs(self):
   567         if not self.revlogs_to_process:
   572         if not self.revlogs_to_process:
   568             self.ui.write((b'no revlogs to process\n'))
   573             self.ui.write((b'no revlogs to process\n'))
   569         else:
   574         else:
   570             self.ui.write((b'processed revlogs:\n'))
   575             self.ui.write((b'processed revlogs:\n'))
   571             for r in sorted(self.revlogs_to_process):
   576             for r in sorted(self.revlogs_to_process):
   572                 self.ui.write((b'  - %s\n' % r))
   577                 self.ui.write((b'  - %s\n' % r))
   573         self.ui.write((b'\n'))
   578         self.ui.write((b'\n'))
       
   579 
       
   580     def has_action(self, name):
       
   581         """ Check whether the upgrade operation will perform this action """
       
   582         return name in self._actions_names
   574 
   583 
   575 
   584 
   576 ###  Code checking if a repository can got through the upgrade process at all. #
   585 ###  Code checking if a repository can got through the upgrade process at all. #
   577 
   586 
   578 
   587