Patchwork D9614: upgrade: drop support for old style optimization names

login
register
mail settings
Submitter phabricator
Date Dec. 16, 2020, 10:15 a.m.
Message ID <differential-rev-PHID-DREV-hdtvw5omia7sjroiedyk-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47916/
State Superseded
Headers show

Comments

phabricator - Dec. 16, 2020, 10:15 a.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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 <https://phab.mercurial-scm.org/rHG5608b5a6c3231c4ec771171cc3079142c7672be6>. The commit states the map is
  there for a while and we can drop them as the underlying command is a debug
  command.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9614

AFFECTED FILES
  mercurial/debugcommands.py
  mercurial/upgrade.py
  tests/test-upgrade-repo.t

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t
--- a/tests/test-upgrade-repo.t
+++ b/tests/test-upgrade-repo.t
@@ -211,7 +211,7 @@ 
 
 --optimize can be used to add optimizations
 
-  $ hg debugupgrade --optimize redeltaparent
+  $ hg debugupgrade --optimize 're-delta-parent'
   (no format upgrades found in existing repository)
   performing an upgrade with "--run" will make the following changes:
   
@@ -1060,7 +1060,7 @@ 
   removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
   copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
   the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
-  $ hg debugupgraderepo --run --optimize redeltafulladd
+  $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
   upgrade will perform the following actions:
   
   requirements
@@ -1289,7 +1289,7 @@ 
         1       1        2        0      p1         21        191         98   0.51309        98         0    0.00000         98         98   1.00000        1
         2       1        2        0   other         30        200        107   0.53500       128        21    0.19626        128        128   0.83594        1
 
-  $ hg debugupgraderepo --run --optimize redeltaall
+  $ hg debugupgraderepo --run --optimize 're-delta-all'
   upgrade will perform the following actions:
   
   requirements
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -22,19 +22,6 @@ 
 
 allformatvariant = upgrade_actions.allformatvariant
 
-# search without '-' to support older form on newer client.
-#
-# We don't enforce backward compatibility for debug command so this
-# might eventually be dropped. However, having to use two different
-# forms in script when comparing result is anoying enough to add
-# backward compatibility for a while.
-legacy_opts_map = {
-    b'redeltaparent': b're-delta-parent',
-    b'redeltamultibase': b're-delta-multibase',
-    b'redeltaall': b're-delta-all',
-    b'redeltafulladd': b're-delta-fulladd',
-}
-
 
 def upgraderepo(
     ui,
@@ -48,8 +35,7 @@ 
 ):
     """Upgrade a repository in place."""
     if optimize is None:
-        optimize = []
-    optimize = {legacy_opts_map.get(o, o) for o in optimize}
+        optimize = {}
     repo = repo.unfiltered()
 
     revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -3925,7 +3925,7 @@ 
       * `--no-changelog --no-manifest --no-filelogs`: skip all filelog optimisation
     """
     return upgrade.upgraderepo(
-        ui, repo, run=run, optimize=optimize, backup=backup, **opts
+        ui, repo, run=run, optimize=set(optimize), backup=backup, **opts
     )