Show More
@@ -32,10 +32,14 b' class passwordmgr(urllib2.HTTPPasswordMg' | |||
|
32 | 32 | user, passwd = auth.get('username'), auth.get('password') |
|
33 | 33 | self.ui.debug("using auth.%s.* for authentication\n" % group) |
|
34 | 34 | if not user or not passwd: |
|
35 | u = util.url(authuri) | |
|
36 | u.query = None | |
|
35 | 37 | if not self.ui.interactive(): |
|
36 |
raise util.Abort(_('http authorization required') |
|
|
38 | raise util.Abort(_('http authorization required for %s') % | |
|
39 | util.hidepassword(str(u))) | |
|
37 | 40 | |
|
38 |
self.ui.write(_("http authorization required\n") |
|
|
41 | self.ui.write(_("http authorization required for %s\n") % | |
|
42 | util.hidepassword(str(u))) | |
|
39 | 43 | self.ui.write(_("realm: %s\n") % realm) |
|
40 | 44 | if user: |
|
41 | 45 | self.ui.write(_("user: %s\n") % user) |
@@ -156,12 +156,24 b' test http authentication' | |||
|
156 | 156 | > --config server.preferuncompressed=True |
|
157 | 157 | $ cat pid >> $DAEMON_PIDS |
|
158 | 158 | |
|
159 | $ cat << EOF > get_pass.py | |
|
160 | > import getpass | |
|
161 | > def newgetpass(arg): | |
|
162 | > return "pass" | |
|
163 | > getpass.getpass = newgetpass | |
|
164 | > EOF | |
|
165 | ||
|
159 | 166 | $ hg id http://localhost:$HGPORT2/ |
|
160 | abort: http authorization required | |
|
167 | abort: http authorization required for http://localhost:$HGPORT2/ | |
|
161 | 168 | [255] |
|
162 |
$ hg id http:// |
|
|
163 | abort: http authorization required | |
|
169 | $ hg id http://localhost:$HGPORT2/ | |
|
170 | abort: http authorization required for http://localhost:$HGPORT2/ | |
|
164 | 171 | [255] |
|
172 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ | |
|
173 | http authorization required for http://localhost:$HGPORT2/ | |
|
174 | realm: mercurial | |
|
175 | user: user | |
|
176 | password: 5fed3813f7f5 | |
|
165 | 177 | $ hg id http://user:pass@localhost:$HGPORT2/ |
|
166 | 178 | 5fed3813f7f5 |
|
167 | 179 | $ echo '[auth]' >> .hg/hgrc |
@@ -183,7 +195,7 b' test http authentication' | |||
|
183 | 195 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
184 | 196 | |
|
185 | 197 | $ hg id http://user2@localhost:$HGPORT2/ |
|
186 | abort: http authorization required | |
|
198 | abort: http authorization required for http://localhost:$HGPORT2/ | |
|
187 | 199 | [255] |
|
188 | 200 | $ hg id http://user:pass2@localhost:$HGPORT2/ |
|
189 | 201 | abort: HTTP Error 403: no |
General Comments 0
You need to be logged in to leave comments.
Login now