[PATCH 1 of 4 evolve-ext] evolve: mechanism to load some commands selectively

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Jun 4 16:00:34 CDT 2015



On 06/04/2015 11:52 AM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon at fb.com>
> # Date 1432164945 25200
> #      Wed May 20 16:35:45 2015 -0700
> # Node ID 8f30edd12b336ecdaec68439d0a92085b6ed8340
> # Parent  b00c2fe51ac8ecb2ef92c5ddab7e45792d87ed07
> evolve: mechanism to load some commands selectively
>
> This patch introduces a new config option to load evolve's command selectively.
> It is part of a sequence of patches to make evolve's command respect the value
> of experimental.evolution. Once these commands are ready and actually respect
> the flag, they are safe to use and can be enabled with the mechanism developed
> in this patch.

This description should mention 'evolutionscommands' and its basic behavior.

>
> diff --git a/hgext/evolve.py b/hgext/evolve.py
> --- a/hgext/evolve.py
> +++ b/hgext/evolve.py
> @@ -45,9 +45,6 @@
>   except (ImportError, AttributeError):
>       gboptslist = gboptsmap = None
>
> -# Flags for enabling optional parts of evolve
> -commandopt = 'allnewcommands'
> -
>   from mercurial import bookmarks
>   from mercurial import cmdutil
>   from mercurial import commands
> @@ -365,10 +362,23 @@
>       # This must be in the same function as the option configuration above to
>       # guarantee it happens after the above configuration, but before the
>       # extsetup functions.
> +    evolvecommands = ui.configlist('experimental', 'evolutioncommands')
>       evolveopts = ui.configlist('experimental', 'evolution')
> -    if evolveopts and (commandopt not in evolveopts and
> -                       'all' not in evolveopts):
> -        cmdtable.clear()
> +    if not evolveopts or 'all' in evolveopts:
> +        # Evolve is fully loaded, don't disable commands
> +        return
> +    else:
> +        whitelist = set()
> +        for cmd in evolvecommands:

Can we get a 'all' value too? and maybe a 'basic' to turn all the one 
who have received necessary polish?

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list