[PATCH 1 of 3 V2] upgrade: add an argument to control manifest upgrade

Yuya Nishihara yuya at tcha.org
Fri Aug 30 23:31:35 EDT 2019


On Wed, 07 Aug 2019 16:29:33 +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at octobus.net>
> # Date 1564439752 -7200
> #      Tue Jul 30 00:35:52 2019 +0200
> # Node ID 8a77cda93b1a7252482a4ca4e420b76936c9ae27
> # Parent  0812d9fb63fe1f417a1bdec3bc292dd953a5fc62
> # EXP-Topic upgrade-select
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 8a77cda93b1a
> upgrade: add an argument to control manifest upgrade

Queued, thanks.

> -def upgraderepo(ui, repo, run=False, optimize=None, backup=True):
> +def upgraderepo(ui, repo, run=False, optimize=None, backup=True,
> +                manifest=None):
>      """Upgrade a repository in place."""
>      if optimize is None:
>          optimize = []
>      optimize = set(legacy_opts_map.get(o, o) for o in optimize)
>      repo = repo.unfiltered()
>  
> +    revlogs = set(UPGRADE_ALL_REVLOGS)
> +    specentries = (('m', manifest),)
> +    specified = [(y, x) for (y, x) in specentries if x is not None]
> +    if specified:
> +        # we have some limitation on revlogs to be recloned
> +        if any(x for y, x in specified):
> +            revlogs = set()
> +            for r, enabled in specified:
> +                if enabled:
> +                    if r == 'm':
> +                        revlogs.add(UPGRADE_MANIFEST)
> +        else:
> +            # none are enabled
> +            for r, __ in specified:
> +                if r == 'm':
> +                    revlogs.discard(UPGRADE_MANIFEST)

I don't like this way of resolving multiple --[no-]$REVLOG options, but
it's a debug command so we can change it later if needed.


More information about the Mercurial-devel mailing list