changeset 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 736a78469a85
files mercurial/httprepo.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/httprepo.py	Sat Oct 28 11:00:59 2006 +0200
+++ b/mercurial/httprepo.py	Sat Oct 28 23:05:57 2006 +0200
@@ -240,8 +240,12 @@
             # this only happens with Python 2.3, later versions raise URLError
             raise util.Abort(_('http error, possibly caused by proxy setting'))
         # record the url we got redirected to
-        if resp.geturl().endswith(qs):
-            self._url = resp.geturl()[:-len(qs)]
+        resp_url = resp.geturl()
+        if resp_url.endswith(qs):
+            resp_url = resp_url[:-len(qs)]
+        if self._url != resp_url:
+            self.ui.status(_('real URL is %s\n') % resp_url)
+            self._url = resp_url
         try:
             proto = resp.getheader('content-type')
         except AttributeError: