comparison mercurial/upgrade_utils/actions.py @ 47062:f38bf44e077f stable

black: make codebase compatible with black v21.4b2 and v20.8b1 I don't know what exact version of black made it care about these whitespace differences, but this is the version I got when I just installed it with `pip3 install black`. I'm intentionally not increasing the version of black required, as I don't want to force everyone to upgrade their version of black, and these fixes are backwards compatible with black v20.8b1. If there are more issues in the future and this becomes a maintenance burden I may do so in a future change. Tested with both versions of black (I got the older version via `pip3 install black==20.8b1`) Differential Revision: https://phab.mercurial-scm.org/D10539
author Kyle Lippincott <spectral@google.com>
date Fri, 30 Apr 2021 16:13:02 -0700
parents e050efe97fbe
children 21b3e6116bd1
comparison
equal deleted inserted replaced
47061:bd2ed1032b4e 47062:f38bf44e077f
845 def print_unused_optimizations(self): 845 def print_unused_optimizations(self):
846 for i in self.unused_optimizations: 846 for i in self.unused_optimizations:
847 self.ui.status(_(b'%s\n %s\n\n') % (i.name, i.description)) 847 self.ui.status(_(b'%s\n %s\n\n') % (i.name, i.description))
848 848
849 def has_upgrade_action(self, name): 849 def has_upgrade_action(self, name):
850 """ Check whether the upgrade operation will perform this action """ 850 """Check whether the upgrade operation will perform this action"""
851 return name in self._upgrade_actions_names 851 return name in self._upgrade_actions_names
852 852
853 def print_post_op_messages(self): 853 def print_post_op_messages(self):
854 """ print post upgrade operation warning messages """ 854 """print post upgrade operation warning messages"""
855 for a in self.upgrade_actions: 855 for a in self.upgrade_actions:
856 if a.postupgrademessage is not None: 856 if a.postupgrademessage is not None:
857 self.ui.warn(b'%s\n' % a.postupgrademessage) 857 self.ui.warn(b'%s\n' % a.postupgrademessage)
858 for a in self.removed_actions: 858 for a in self.removed_actions:
859 if a.postdowngrademessage is not None: 859 if a.postdowngrademessage is not None: