comparison mercurial/httprepo.py @ 14641:f2789767a2c4

http: report unexpected unparsable push responses (issue2777)
author Matt Mackall <mpm@selenic.com>
date Thu, 16 Jun 2011 13:24:42 -0500
parents 4f695345979c
children ba3c36cea66e
comparison
equal deleted inserted replaced
14640:406b6d7bdcb9 14641:f2789767a2c4
189 headers = {'Content-Type': 'application/mercurial-0.1'} 189 headers = {'Content-Type': 'application/mercurial-0.1'}
190 190
191 try: 191 try:
192 try: 192 try:
193 r = self._call(cmd, data=fp, headers=headers, **args) 193 r = self._call(cmd, data=fp, headers=headers, **args)
194 return r.split('\n', 1) 194 vals = r.split('\n', 1)
195 if len(vals) < 2:
196 raise error.ResponseError(_("unexpected response:"), d)
197 return vals
195 except socket.error, err: 198 except socket.error, err:
196 if err.args[0] in (errno.ECONNRESET, errno.EPIPE): 199 if err.args[0] in (errno.ECONNRESET, errno.EPIPE):
197 raise util.Abort(_('push failed: %s') % err.args[1]) 200 raise util.Abort(_('push failed: %s') % err.args[1])
198 raise util.Abort(err.args[1]) 201 raise util.Abort(err.args[1])
199 finally: 202 finally: