diff mercurial/upgrade_utils/actions.py @ 46056:c407513a44a3

upgrade: start moving the "to be happening" data in a dedicated object The upgrade code has a lot of logic to determine which action needs to be performed depending of various element (sometimes depending from each other). It would be nice to have a consistent object representing this. That could be cleanly passed and avoid some logic duplication. So we create this object as a start. Differential Revision: https://phab.mercurial-scm.org/D9487
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 01 Dec 2020 22:37:34 +0100
parents 08802795ae90
children 945b33a7edfd
line wrap: on
line diff
--- a/mercurial/upgrade_utils/actions.py	Sun Dec 06 20:38:01 2020 -0500
+++ b/mercurial/upgrade_utils/actions.py	Tue Dec 01 22:37:34 2020 +0100
@@ -554,6 +554,15 @@
     return newactions
 
 
+class UpgradeOperation(object):
+    """represent the work to be done during an upgrade"""
+
+    def __init__(self, requirements, actions, revlogs_to_process):
+        self.requirements = requirements
+        self.actions = actions
+        self.revlogs_to_process = revlogs_to_process
+
+
 ###  Code checking if a repository can got through the upgrade process at all. #