[PATCH 5 of 8] configitems: register 'ui.interactive'

Yuya Nishihara yuya at tcha.org
Fri Jun 23 11:03:45 EDT 2017


On Wed, 21 Jun 2017 10:55:06 +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at octobus.net>
> # Date 1497695761 -7200
> #      Sat Jun 17 12:36:01 2017 +0200
> # Node ID 26bc51ab6c2c49778e967807ec0b594fd7ac7d2e
> # Parent  c718cdbf2b211faec1925a3728af5aedd7b9a69a
> # EXP-Topic config.register
> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 26bc51ab6c2c
> configitems: register 'ui.interactive'
> 
> That item default value is a bit special (None) so this adds a second proof
> that everything is still working fine.
> 
> diff --git a/mercurial/configitems.py b/mercurial/configitems.py
> --- a/mercurial/configitems.py
> +++ b/mercurial/configitems.py
> @@ -36,6 +36,9 @@ def coreconfigitem(*args, **kwargs):
>  
>  # Registering actual config items
>  
> +coreconfigitem('ui', 'interactive',
> +    default=None,
> +)
>  coreconfigitem('ui', 'quiet',
>      default=False,
>  )
> diff --git a/mercurial/ui.py b/mercurial/ui.py
> --- a/mercurial/ui.py
> +++ b/mercurial/ui.py
> @@ -1125,7 +1125,7 @@ class ui(object):
>  
>          This function refers to input only; for output, see `ui.formatted()'.
>          '''
> -        i = self.configbool("ui", "interactive", None)
> +        i = self.configbool("ui", "interactive")

v=None is ignored by configbool() so interactive operation would be disabled.

>          if i is None:
>              # some environments replace stdin without implementing isatty
>              # usually those are non-interactive


More information about the Mercurial-devel mailing list