[PATCH 2 of 5] httpconnection: rename config to groups
Augie Fackler
raf at durin42.com
Sat Mar 11 13:34:38 EST 2017
On Thu, Mar 09, 2017 at 10:41:17PM -0800, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1489121594 28800
> # Thu Mar 09 20:53:14 2017 -0800
> # Node ID 7f05aef6f3056a0a258b45158a47c462bca9e3c8
> # Parent 9f591a8a0600c08f2facb3447213fdcfb14fd601
> httpconnection: rename config to groups
Taken patches 1 and 2, will look at 3-5 later.
>
> Because that is what it is.
>
> diff --git a/mercurial/httpconnection.py b/mercurial/httpconnection.py
> --- a/mercurial/httpconnection.py
> +++ b/mercurial/httpconnection.py
> @@ -67,13 +67,13 @@ class httpsendfile(object):
> # moved here from url.py to avoid a cycle
> def readauthforuri(ui, uri, user):
> # Read configuration
> - config = {}
> + groups = {}
> for key, val in ui.configitems('auth'):
> if '.' not in key:
> ui.warn(_("ignoring invalid [auth] key '%s'\n") % key)
> continue
> group, setting = key.rsplit('.', 1)
> - gdict = config.setdefault(group, {})
> + gdict = groups.setdefault(group, {})
> if setting in ('username', 'cert', 'key'):
> val = util.expandpath(val)
> gdict[setting] = val
> @@ -83,7 +83,7 @@ def readauthforuri(ui, uri, user):
> bestuser = None
> bestlen = 0
> bestauth = None
> - for group, auth in config.iteritems():
> + for group, auth in groups.iteritems():
> if user and user != auth.get('username', user):
> # If a username was set in the URI, the entry username
> # must either match it or be unset
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list