Patchwork D9468: upgrade: add an explicite --filelogs arguments

login
register
mail settings
Submitter phabricator
Date Nov. 30, 2020, 3:44 p.m.
Message ID <differential-rev-PHID-DREV-v5agmdlyha6wm7pn4d7n-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47747/
State Superseded
Headers show

Comments

phabricator - Nov. 30, 2020, 3:44 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This make it possible to select no revlog for upgrade, which is useful for some
  upgrade target or in some specific cases.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

CHANGE DETAILS




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

Patch

diff --git a/tests/test-completion.t b/tests/test-completion.t
--- a/tests/test-completion.t
+++ b/tests/test-completion.t
@@ -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
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -1146,6 +1146,7 @@ 
     backup=True,
     manifest=None,
     changelog=None,
+    filelogs=None,
 ):
     """Upgrade a repository in place."""
     if optimize is None:
@@ -1156,7 +1157,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:
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -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