mercurial/httprepo.py
changeset 5930 c301f15c965a
parent 5915 d0576d065993
child 6001 30d2fecaab76
equal deleted inserted replaced
5929:e160f2312815 5930:c301f15c965a
   341         if proto.startswith('application/mercurial-'):
   341         if proto.startswith('application/mercurial-'):
   342             try:
   342             try:
   343                 version = proto.split('-', 1)[1]
   343                 version = proto.split('-', 1)[1]
   344                 version_info = tuple([int(n) for n in version.split('.')])
   344                 version_info = tuple([int(n) for n in version.split('.')])
   345             except ValueError:
   345             except ValueError:
   346                 raise repo.RepoError(_("'%s' sent a broken Content-type "
   346                 raise repo.RepoError(_("'%s' sent a broken Content-Type "
   347                                      "header (%s)") % (self._url, proto))
   347                                      "header (%s)") % (self._url, proto))
   348             if version_info > (0, 1):
   348             if version_info > (0, 1):
   349                 raise repo.RepoError(_("'%s' uses newer protocol %s") %
   349                 raise repo.RepoError(_("'%s' uses newer protocol %s") %
   350                                    (self._url, version))
   350                                    (self._url, version))
   351 
   351 
   426         fp = httpsendfile(tempname, "rb")
   426         fp = httpsendfile(tempname, "rb")
   427         try:
   427         try:
   428             try:
   428             try:
   429                 rfp = self.do_cmd(
   429                 rfp = self.do_cmd(
   430                     'unbundle', data=fp,
   430                     'unbundle', data=fp,
   431                     headers={'content-type': 'application/octet-stream'},
   431                     headers={'Content-Type': 'application/octet-stream'},
   432                     heads=' '.join(map(hex, heads)))
   432                     heads=' '.join(map(hex, heads)))
   433                 try:
   433                 try:
   434                     ret = int(rfp.readline())
   434                     ret = int(rfp.readline())
   435                     self.ui.write(rfp.read())
   435                     self.ui.write(rfp.read())
   436                     return ret
   436                     return ret