##// END OF EJS Templates
upgrade: move the revlog selection code lower down the chain...
marmoute -
r49273:6e045497 default
parent child Browse files
Show More
@@ -45,24 +45,11 b' def upgraderepo('
45 optimize = {}
45 optimize = {}
46 repo = repo.unfiltered()
46 repo = repo.unfiltered()
47
47
48 revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
49 specentries = (
48 specentries = (
50 (upgrade_engine.UPGRADE_CHANGELOG, changelog),
49 (upgrade_engine.UPGRADE_CHANGELOG, changelog),
51 (upgrade_engine.UPGRADE_MANIFEST, manifest),
50 (upgrade_engine.UPGRADE_MANIFEST, manifest),
52 (upgrade_engine.UPGRADE_FILELOGS, filelogs),
51 (upgrade_engine.UPGRADE_FILELOGS, filelogs),
53 )
52 )
54 specified = [(y, x) for (y, x) in specentries if x is not None]
55 if specified:
56 # we have some limitation on revlogs to be recloned
57 if any(x for y, x in specified):
58 revlogs = set()
59 for upgrade, enabled in specified:
60 if enabled:
61 revlogs.add(upgrade)
62 else:
63 # none are enabled
64 for upgrade, __ in specified:
65 revlogs.discard(upgrade)
66
53
67 # Ensure the repository can be upgraded.
54 # Ensure the repository can be upgraded.
68 upgrade_actions.check_source_requirements(repo)
55 upgrade_actions.check_source_requirements(repo)
@@ -99,6 +86,24 b' def upgraderepo('
99 removedreqs = repo.requirements - newreqs
86 removedreqs = repo.requirements - newreqs
100 addedreqs = newreqs - repo.requirements
87 addedreqs = newreqs - repo.requirements
101
88
89 # check if we need to touch revlog and if so, which ones
90
91 revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
92 specified = [(y, x) for (y, x) in specentries if x is not None]
93 if specified:
94 # we have some limitation on revlogs to be recloned
95 if any(x for y, x in specified):
96 revlogs = set()
97 for upgrade, enabled in specified:
98 if enabled:
99 revlogs.add(upgrade)
100 else:
101 # none are enabled
102 for upgrade, __ in specified:
103 revlogs.discard(upgrade)
104
105 # check the consistency of the revlog selection with the planned action
106
102 if revlogs != upgrade_engine.UPGRADE_ALL_REVLOGS:
107 if revlogs != upgrade_engine.UPGRADE_ALL_REVLOGS:
103 incompatible = upgrade_actions.RECLONES_REQUIREMENTS & (
108 incompatible = upgrade_actions.RECLONES_REQUIREMENTS & (
104 removedreqs | addedreqs
109 removedreqs | addedreqs
General Comments 0
You need to be logged in to leave comments. Login now