##// END OF EJS Templates
httprepo: record the url after a request, makes pull + redirect works...
Benoit Boissinot -
r3562:88b4755f default
parent child Browse files
Show More
@@ -218,8 +218,8 b' class httprepository(remoterepository):'
218 self.ui.debug(_("sending %s command\n") % cmd)
218 self.ui.debug(_("sending %s command\n") % cmd)
219 q = {"cmd": cmd}
219 q = {"cmd": cmd}
220 q.update(args)
220 q.update(args)
221 qs = urllib.urlencode(q)
221 qs = '?%s' % urllib.urlencode(q)
222 cu = "%s?%s" % (self._url, qs)
222 cu = "%s%s" % (self._url, qs)
223 try:
223 try:
224 resp = urllib2.urlopen(urllib2.Request(cu, data, headers))
224 resp = urllib2.urlopen(urllib2.Request(cu, data, headers))
225 except urllib2.HTTPError, inst:
225 except urllib2.HTTPError, inst:
@@ -233,6 +233,8 b' class httprepository(remoterepository):'
233 except IndexError:
233 except IndexError:
234 # this only happens with Python 2.3, later versions raise URLError
234 # this only happens with Python 2.3, later versions raise URLError
235 raise util.Abort(_('http error, possibly caused by proxy setting'))
235 raise util.Abort(_('http error, possibly caused by proxy setting'))
236 # record the url we got redirected to
237 self._url = resp.geturl().rstrip(qs)
236 try:
238 try:
237 proto = resp.getheader('content-type')
239 proto = resp.getheader('content-type')
238 except AttributeError:
240 except AttributeError:
General Comments 0
You need to be logged in to leave comments. Login now