On Sun, 25 Jun 2017 18:34:38 +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.da...@octobus.net>
> # Date 1498394074 -7200
> #      Sun Jun 25 14:34:34 2017 +0200
> # Node ID 290508394c236b288e1b2ebf3d60a28843f9fa00
> # Parent  181ca34883e67e99bf6340b5931ac6d5a894092f
> # 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 290508394c23
> config: extra the core config logic into a private method

Queued these, thanks.

>      def config(self, section, name, default=_unset, untrusted=False):
> +        """return the plain string version of a config"""
> +        value = self._config(section, name, default=default,
> +                             untrusted=untrusted)
> +        if value is _unset:
> +            return None
> +        return value
> +
> +    def _config(self, section, name, default=_unset, untrusted=False):
> +        value = default
>          if isinstance(name, list):
>              alternates = name
> -            # let us ignore the config items in the alternates case for now
> -            if default is _unset:
> -                default = None

I think this comment is still valid. If name is a list, no default would be
taken from the registered defaults.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to