mercurial/httprepo.py
changeset 3126 cff3c58a5766
parent 3069 bc3fe3b5b785
child 3160 36ab673f66a5
equal deleted inserted replaced
3125:2e043c9a38a6 3126:cff3c58a5766
   129         self._url = urlparse.urlunsplit((scheme, netlocunsplit(host, port),
   129         self._url = urlparse.urlunsplit((scheme, netlocunsplit(host, port),
   130                                          urlpath, '', ''))
   130                                          urlpath, '', ''))
   131         self.ui = ui
   131         self.ui = ui
   132 
   132 
   133         proxyurl = ui.config("http_proxy", "host") or os.getenv('http_proxy')
   133         proxyurl = ui.config("http_proxy", "host") or os.getenv('http_proxy')
   134         proxyauthinfo = None
   134         # XXX proxyauthinfo = None
   135         handler = httphandler()
   135         handler = httphandler()
   136 
   136 
   137         if proxyurl:
   137         if proxyurl:
   138             # proxy can be proper url or host[:port]
   138             # proxy can be proper url or host[:port]
   139             if not (proxyurl.startswith('http:') or
   139             if not (proxyurl.startswith('http:') or
   286             raise
   286             raise
   287 
   287 
   288     def changegroup(self, nodes, kind):
   288     def changegroup(self, nodes, kind):
   289         n = " ".join(map(hex, nodes))
   289         n = " ".join(map(hex, nodes))
   290         f = self.do_cmd("changegroup", roots=n)
   290         f = self.do_cmd("changegroup", roots=n)
   291         bytes = 0
       
   292 
   291 
   293         def zgenerator(f):
   292         def zgenerator(f):
   294             zd = zlib.decompressobj()
   293             zd = zlib.decompressobj()
   295             try:
   294             try:
   296                 for chnk in f:
   295                 for chnk in f:
   297                     yield zd.decompress(chnk)
   296                     yield zd.decompress(chnk)
   298             except httplib.HTTPException, inst:
   297             except httplib.HTTPException:
   299                 raise IOError(None, _('connection ended unexpectedly'))
   298                 raise IOError(None, _('connection ended unexpectedly'))
   300             yield zd.flush()
   299             yield zd.flush()
   301 
   300 
   302         return util.chunkbuffer(zgenerator(util.filechunkiter(f)))
   301         return util.chunkbuffer(zgenerator(util.filechunkiter(f)))
   303 
   302