Mercurial > public > mercurial-scm > hg
comparison mercurial/httprepo.py @ 3570:c141d07198b9
Inform the user about the new URL when being redirected via http.
Additionally the changed code ensures that the new URL is used,
even if it doesn't end with the query string.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Sat, 28 Oct 2006 23:05:57 +0200 |
parents | a27d90c9336e |
children | 802da51cab5b |
comparison
equal
deleted
inserted
replaced
3569:a27d90c9336e | 3570:c141d07198b9 |
---|---|
238 raise IOError(None, inst) | 238 raise IOError(None, inst) |
239 except IndexError: | 239 except IndexError: |
240 # this only happens with Python 2.3, later versions raise URLError | 240 # this only happens with Python 2.3, later versions raise URLError |
241 raise util.Abort(_('http error, possibly caused by proxy setting')) | 241 raise util.Abort(_('http error, possibly caused by proxy setting')) |
242 # record the url we got redirected to | 242 # record the url we got redirected to |
243 if resp.geturl().endswith(qs): | 243 resp_url = resp.geturl() |
244 self._url = resp.geturl()[:-len(qs)] | 244 if resp_url.endswith(qs): |
245 resp_url = resp_url[:-len(qs)] | |
246 if self._url != resp_url: | |
247 self.ui.status(_('real URL is %s\n') % resp_url) | |
248 self._url = resp_url | |
245 try: | 249 try: |
246 proto = resp.getheader('content-type') | 250 proto = resp.getheader('content-type') |
247 except AttributeError: | 251 except AttributeError: |
248 proto = resp.headers['content-type'] | 252 proto = resp.headers['content-type'] |
249 | 253 |