comparison mercurial/upgrade.py @ 46208:083438d6f403

upgrade: drop support for old style optimization names Old style optimization names like `redeltaparent` were converted into `re-delta-parent` more than two years ago. The old names were kept around for sometime because of BC reasons. Refer 5608b5a6c3231c4ec771171cc3079142c7672be6. The commit states the map is there for a while and we can drop them as the underlying command is a debug command. Differential Revision: https://phab.mercurial-scm.org/D9614
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 16 Dec 2020 12:39:15 +0530
parents e2139e071b5c
children a51d345f1404
comparison
equal deleted inserted replaced
46207:e2139e071b5c 46208:083438d6f403
19 actions as upgrade_actions, 19 actions as upgrade_actions,
20 engine as upgrade_engine, 20 engine as upgrade_engine,
21 ) 21 )
22 22
23 allformatvariant = upgrade_actions.allformatvariant 23 allformatvariant = upgrade_actions.allformatvariant
24
25 # search without '-' to support older form on newer client.
26 #
27 # We don't enforce backward compatibility for debug command so this
28 # might eventually be dropped. However, having to use two different
29 # forms in script when comparing result is anoying enough to add
30 # backward compatibility for a while.
31 legacy_opts_map = {
32 b'redeltaparent': b're-delta-parent',
33 b'redeltamultibase': b're-delta-multibase',
34 b'redeltaall': b're-delta-all',
35 b'redeltafulladd': b're-delta-fulladd',
36 }
37 24
38 25
39 def upgraderepo( 26 def upgraderepo(
40 ui, 27 ui,
41 repo, 28 repo,
46 changelog=None, 33 changelog=None,
47 filelogs=None, 34 filelogs=None,
48 ): 35 ):
49 """Upgrade a repository in place.""" 36 """Upgrade a repository in place."""
50 if optimize is None: 37 if optimize is None:
51 optimize = [] 38 optimize = {}
52 optimize = {legacy_opts_map.get(o, o) for o in optimize}
53 repo = repo.unfiltered() 39 repo = repo.unfiltered()
54 40
55 revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS) 41 revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
56 specentries = ( 42 specentries = (
57 (upgrade_engine.UPGRADE_CHANGELOG, changelog), 43 (upgrade_engine.UPGRADE_CHANGELOG, changelog),