Show More
@@ -67,13 +67,13 b' class httpsendfile(object):' | |||||
67 | # moved here from url.py to avoid a cycle |
|
67 | # moved here from url.py to avoid a cycle | |
68 | def readauthforuri(ui, uri, user): |
|
68 | def readauthforuri(ui, uri, user): | |
69 | # Read configuration |
|
69 | # Read configuration | |
70 |
|
|
70 | groups = {} | |
71 | for key, val in ui.configitems('auth'): |
|
71 | for key, val in ui.configitems('auth'): | |
72 | if '.' not in key: |
|
72 | if '.' not in key: | |
73 | ui.warn(_("ignoring invalid [auth] key '%s'\n") % key) |
|
73 | ui.warn(_("ignoring invalid [auth] key '%s'\n") % key) | |
74 | continue |
|
74 | continue | |
75 | group, setting = key.rsplit('.', 1) |
|
75 | group, setting = key.rsplit('.', 1) | |
76 |
gdict = |
|
76 | gdict = groups.setdefault(group, {}) | |
77 | if setting in ('username', 'cert', 'key'): |
|
77 | if setting in ('username', 'cert', 'key'): | |
78 | val = util.expandpath(val) |
|
78 | val = util.expandpath(val) | |
79 | gdict[setting] = val |
|
79 | gdict[setting] = val | |
@@ -83,7 +83,7 b' def readauthforuri(ui, uri, user):' | |||||
83 | bestuser = None |
|
83 | bestuser = None | |
84 | bestlen = 0 |
|
84 | bestlen = 0 | |
85 | bestauth = None |
|
85 | bestauth = None | |
86 |
for group, auth in |
|
86 | for group, auth in groups.iteritems(): | |
87 | if user and user != auth.get('username', user): |
|
87 | if user and user != auth.get('username', user): | |
88 | # If a username was set in the URI, the entry username |
|
88 | # If a username was set in the URI, the entry username | |
89 | # must either match it or be unset |
|
89 | # must either match it or be unset |
General Comments 0
You need to be logged in to leave comments.
Login now