##// END OF EJS Templates
upgrade: split some logic from UpgradeOperation...
marmoute -
r50088:56606682 default
parent child Browse files
Show More
@@ -691,7 +691,24 b' def determine_upgrade_actions('
691 return newactions
691 return newactions
692
692
693
693
694 class UpgradeOperation:
694 class BaseOperation:
695 """base class that contains the minimum for an upgrade to work
696
697 (this might need to be extended as the usage for subclass alternative to
698 UpgradeOperation extends)
699 """
700
701 def __init__(
702 self,
703 new_requirements,
704 backup_store,
705 ):
706 self.new_requirements = new_requirements
707 # should this operation create a backup of the store
708 self.backup_store = backup_store
709
710
711 class UpgradeOperation(BaseOperation):
695 """represent the work to be done during an upgrade"""
712 """represent the work to be done during an upgrade"""
696
713
697 def __init__(
714 def __init__(
@@ -704,8 +721,11 b' class UpgradeOperation:'
704 revlogs_to_process,
721 revlogs_to_process,
705 backup_store,
722 backup_store,
706 ):
723 ):
724 super().__init__(
725 new_requirements,
726 backup_store,
727 )
707 self.ui = ui
728 self.ui = ui
708 self.new_requirements = new_requirements
709 self.current_requirements = current_requirements
729 self.current_requirements = current_requirements
710 # list of upgrade actions the operation will perform
730 # list of upgrade actions the operation will perform
711 self.upgrade_actions = upgrade_actions
731 self.upgrade_actions = upgrade_actions
@@ -747,9 +767,6 b' class UpgradeOperation:'
747 b're-delta-multibase' in upgrade_actions_names
767 b're-delta-multibase' in upgrade_actions_names
748 )
768 )
749
769
750 # should this operation create a backup of the store
751 self.backup_store = backup_store
752
753 @property
770 @property
754 def upgrade_actions_names(self):
771 def upgrade_actions_names(self):
755 return set([a.name for a in self.upgrade_actions])
772 return set([a.name for a in self.upgrade_actions])
General Comments 0
You need to be logged in to leave comments. Login now