Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
46055:7740d5102760 | 46056:c407513a44a3 |
---|---|
552 # e.g. adding generaldelta could schedule parent redeltas. | 552 # e.g. adding generaldelta could schedule parent redeltas. |
553 | 553 |
554 return newactions | 554 return newactions |
555 | 555 |
556 | 556 |
557 class UpgradeOperation(object): | |
558 """represent the work to be done during an upgrade""" | |
559 | |
560 def __init__(self, requirements, actions, revlogs_to_process): | |
561 self.requirements = requirements | |
562 self.actions = actions | |
563 self.revlogs_to_process = revlogs_to_process | |
564 | |
565 | |
557 ### Code checking if a repository can got through the upgrade process at all. # | 566 ### Code checking if a repository can got through the upgrade process at all. # |
558 | 567 |
559 | 568 |
560 def requiredsourcerequirements(repo): | 569 def requiredsourcerequirements(repo): |
561 """Obtain requirements required to be present to upgrade a repo. | 570 """Obtain requirements required to be present to upgrade a repo. |