http: report unexpected unparsable push responses (
issue2777)
--- a/mercurial/httprepo.py Tue Jun 07 13:39:09 2011 +0300
+++ b/mercurial/httprepo.py Thu Jun 16 13:24:42 2011 -0500
@@ -191,7 +191,10 @@
try:
try:
r = self._call(cmd, data=fp, headers=headers, **args)
- return r.split('\n', 1)
+ vals = r.split('\n', 1)
+ if len(vals) < 2:
+ raise error.ResponseError(_("unexpected response:"), d)
+ return vals
except socket.error, err:
if err.args[0] in (errno.ECONNRESET, errno.EPIPE):
raise util.Abort(_('push failed: %s') % err.args[1])