mercurial/httprepo.py
changeset 2294 ce67fa312f61
parent 2281 7761597b5da3
child 2336 f77edcffb837
equal deleted inserted replaced
2293:3dc6f2501dbc 2294:ce67fa312f61
   101         self.ui.debug(_("sending %s command\n") % cmd)
   101         self.ui.debug(_("sending %s command\n") % cmd)
   102         q = {"cmd": cmd}
   102         q = {"cmd": cmd}
   103         q.update(args)
   103         q.update(args)
   104         qs = urllib.urlencode(q)
   104         qs = urllib.urlencode(q)
   105         cu = "%s?%s" % (self.url, qs)
   105         cu = "%s?%s" % (self.url, qs)
   106         resp = urllib2.urlopen(cu)
   106         try:
       
   107             resp = urllib2.urlopen(cu)
       
   108         except httplib.HTTPException, inst:
       
   109             raise IOError(None, _('http error while sending %s command') % cmd)
   107         proto = resp.headers['content-type']
   110         proto = resp.headers['content-type']
   108 
   111 
   109         # accept old "text/plain" and "application/hg-changegroup" for now
   112         # accept old "text/plain" and "application/hg-changegroup" for now
   110         if not proto.startswith('application/mercurial') and \
   113         if not proto.startswith('application/mercurial') and \
   111                not proto.startswith('text/plain') and \
   114                not proto.startswith('text/plain') and \