mercurial/httprepo.py
changeset 3613 cbf352b9a3cd
parent 3609 a969e81631ce
child 3614 fd7a018b7db7
equal deleted inserted replaced
3612:d1b16a746db6 3613:cbf352b9a3cd
   335 
   335 
   336     def unbundle(self, cg, heads, source):
   336     def unbundle(self, cg, heads, source):
   337         # have to stream bundle to a temp file because we do not have
   337         # have to stream bundle to a temp file because we do not have
   338         # http 1.1 chunked transfer.
   338         # http 1.1 chunked transfer.
   339 
   339 
   340         use_compress = 'standardbundle' in self.capabilities
       
   341 
       
   342         # XXX duplication from commands.py
   340         # XXX duplication from commands.py
   343         class nocompress(object):
   341         class nocompress(object):
   344             def compress(self, x):
   342             def compress(self, x):
   345                 return x
   343                 return x
   346             def flush(self):
   344             def flush(self):
   347                 return ""
   345                 return ""
   348 
   346 
   349         if use_compress:
   347         unbundleversions = self.capable('unbundle')
       
   348         try:
       
   349             unbundleversions = unbundleversions.split(',')
       
   350         except AttributeError:
       
   351             unbundleversions = [""]
       
   352 
       
   353         if "HG10GZ" in unbundleversions:
   350             header = "HG10GZ"
   354             header = "HG10GZ"
   351             z = zlib.compressobj()
   355             z = zlib.compressobj()
   352         else:
   356         else:
   353             self.ui.note(_("server has no compression support, "
   357             self.ui.note(_("server has no compression support, "
   354                            "sending uncompressed"))
   358                            "sending uncompressed"))