wireproto: catch possible cast error in pushkey
The server can return an unexpected answer like 'ssl required'. We catch those
possible cast errors and abort the operation.
--- a/mercurial/wireproto.py Sun Feb 20 18:06:05 2011 +0100
+++ b/mercurial/wireproto.py Mon Feb 21 00:37:55 2011 +0100
@@ -80,7 +80,12 @@
key=encoding.fromlocal(key),
old=encoding.fromlocal(old),
new=encoding.fromlocal(new))
- return bool(int(d))
+ try:
+ d = bool(int(d))
+ except ValueError:
+ raise error.ResponseError(
+ _('push failed (unexpected response):'), d)
+ return d
def listkeys(self, namespace):
if not self.capable('pushkey'):