mercurial/httprepo.py
changeset 3569 a27d90c9336e
parent 3553 3bab1fc0ab75
child 3570 c141d07198b9
--- a/mercurial/httprepo.py
+++ b/mercurial/httprepo.py
@@ -240,7 +240,8 @@ class httprepository(remoterepository):
             # 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
-        self._url = resp.geturl().rstrip(qs)
+        if resp.geturl().endswith(qs):
+            self._url = resp.geturl()[:-len(qs)]
         try:
             proto = resp.getheader('content-type')
         except AttributeError: