diff mercurial/debugcommands.py @ 42830:cf2b765cecd7

upgrade: add an argument to control manifest upgrade The argument can be used to only "clone" manifest revlog or clone all of them but this one. The selection will make more sense once we have a `--changelog` flag in the next changesets.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 30 Jul 2019 00:35:52 +0200
parents 127d57e950e0
children 908ff446590e
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Fri Aug 30 18:11:41 2019 +0200
+++ b/mercurial/debugcommands.py	Tue Jul 30 00:35:52 2019 +0200
@@ -2848,8 +2848,9 @@
     ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
     ('', 'run', False, _('performs an upgrade')),
     ('', 'backup', True, _('keep the old repository content around')),
+    ('', 'manifest', None, _('select the manifest for upgrade')),
 ])
-def debugupgraderepo(ui, repo, run=False, optimize=None, backup=True):
+def debugupgraderepo(ui, repo, run=False, optimize=None, backup=True, **opts):
     """upgrade a repository to use different features
 
     If no arguments are specified, the repository is evaluated for upgrade
@@ -2867,9 +2868,15 @@
     rename some directories inside the ``.hg`` directory. On most machines, this
     should complete almost instantaneously and the chances of a consumer being
     unable to access the repository should be low.
+
+    By default, all revlog will be upgraded. You can restrict this using flag
+    such as `--manifest`:
+
+      * `--manifest`: only optimize the manifest
+      * `--no-manifest`: optimize all revlog but the manifest
     """
     return upgrade.upgraderepo(ui, repo, run=run, optimize=optimize,
-                               backup=backup)
+                               backup=backup, **opts)
 
 @command('debugwalk', cmdutil.walkopts, _('[OPTION]... [FILE]...'),
          inferrepo=True)