[PATCH 5 of 7] color: add the definition of '--color' in core

Yuya Nishihara yuya at tcha.org
Mon Feb 27 09:41:26 EST 2017


On Sat, 25 Feb 2017 14:11:37 +0100, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> # Date 1487696961 -3600
> #      Tue Feb 21 18:09:21 2017 +0100
> # Node ID 25fd71d9347a8c82adf2a991dab0b48ff35282f6
> # Parent  1b39bb158cdb97965da0b614b7c8bcd6a8b58887
> # EXP-Topic color
> color: add the definition of '--color' in core

> diff -r 1b39bb158cdb -r 25fd71d9347a hgext/color.py
> --- a/hgext/color.py	Tue Feb 21 17:51:43 2017 +0100
> +++ b/hgext/color.py	Tue Feb 21 18:09:21 2017 +0100
> @@ -198,12 +198,13 @@ def uisetup(ui):
>      extensions.wrapfunction(dispatch, '_runcommand', colorcmd)
>  
>  def extsetup(ui):
> -    commands.globalopts.append(
> -        ('', 'color', 'auto',
> -         # i18n: 'always', 'auto', 'never', and 'debug' are keywords
> -         # and should not be translated
> -         _("when to colorize (boolean, always, auto, never, or debug)"),
> -         _('TYPE')))
> +    # change default color config
> +    for idx, entry in enumerate(commands.globalopts):
> +        if entry[1] == 'color':
> +            patch = ('auto', entry[3].replace(' (EXPERIMENTAL', ''))
                                                    ^^^^^^^^^^^^

Missed ')', fixed.

This won't work if the message is translated, but I expect the color extension
will be deprecated soon and the problem will go away.


More information about the Mercurial-devel mailing list