upgrade: add an explicite --filelogs arguments
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 30 Nov 2020 14:06:45 +0100
changeset 45997 7c539f0febbe
parent 45996 904647f7d983
child 45998 cb623dedb17c
upgrade: add an explicite --filelogs arguments This make it possible to select no revlog for upgrade, which is useful for some upgrade target or in some specific cases (eg: persistent-nodemap or share-safe update). Differential Revision: https://phab.mercurial-scm.org/D9468
mercurial/debugcommands.py
mercurial/upgrade.py
tests/test-completion.t
--- a/mercurial/debugcommands.py	Mon Nov 30 19:26:54 2020 +0100
+++ b/mercurial/debugcommands.py	Mon Nov 30 14:06:45 2020 +0100
@@ -3838,6 +3838,7 @@
         (b'', b'backup', True, _(b'keep the old repository content around')),
         (b'', b'changelog', None, _(b'select the changelog for upgrade')),
         (b'', b'manifest', None, _(b'select the manifest for upgrade')),
+        (b'', b'filelogs', None, _(b'select all filelogs for upgrade')),
     ],
 )
 def debugupgraderepo(ui, repo, run=False, optimize=None, backup=True, **opts):
@@ -3866,6 +3867,8 @@
       * `--no-manifest`: optimize all revlog but the manifest
       * `--changelog`: optimize the changelog only
       * `--no-changelog --no-manifest`: optimize filelogs only
+      * `--filelogs`: optimize the filelogs only
+      * `--no-changelog --no-manifest --no-filelogs`: skip all filelog optimisation
     """
     return upgrade.upgraderepo(
         ui, repo, run=run, optimize=optimize, backup=backup, **opts
--- a/mercurial/upgrade.py	Mon Nov 30 19:26:54 2020 +0100
+++ b/mercurial/upgrade.py	Mon Nov 30 14:06:45 2020 +0100
@@ -1152,6 +1152,7 @@
     backup=True,
     manifest=None,
     changelog=None,
+    filelogs=None,
 ):
     """Upgrade a repository in place."""
     if optimize is None:
@@ -1162,7 +1163,8 @@
     revlogs = set(UPGRADE_ALL_REVLOGS)
     specentries = (
         (UPGRADE_CHANGELOG, changelog),
-        (UPGRADE_MANIFEST, manifest)
+        (UPGRADE_MANIFEST, manifest),
+        (UPGRADE_FILELOGS, filelogs),
     )
     specified = [(y, x) for (y, x) in specentries if x is not None]
     if specified:
--- a/tests/test-completion.t	Mon Nov 30 19:26:54 2020 +0100
+++ b/tests/test-completion.t	Mon Nov 30 14:06:45 2020 +0100
@@ -328,7 +328,7 @@
   debuguigetpass: prompt
   debuguiprompt: prompt
   debugupdatecaches: 
-  debugupgraderepo: optimize, run, backup, changelog, manifest
+  debugupgraderepo: optimize, run, backup, changelog, manifest, filelogs
   debugwalk: include, exclude
   debugwhyunstable: 
   debugwireargs: three, four, five, ssh, remotecmd, insecure