Mercurial > hg
comparison mercurial/wireproto.py @ 15652:ca6accdad79c
wireproto: handle other server output in pushkey
Remote side may add useful information alongside failure return code. For
example "ssl is required". This patch mirror what is done for the unbundle
command.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Mon, 12 Dec 2011 15:16:58 +0100 |
parents | a348739da8f0 |
children | cff25e4b37d2 |
comparison
equal
deleted
inserted
replaced
15651:e69a3cdad37e | 15652:ca6accdad79c |
---|---|
237 yield todict(namespace=encoding.fromlocal(namespace), | 237 yield todict(namespace=encoding.fromlocal(namespace), |
238 key=encoding.fromlocal(key), | 238 key=encoding.fromlocal(key), |
239 old=encoding.fromlocal(old), | 239 old=encoding.fromlocal(old), |
240 new=encoding.fromlocal(new)), f | 240 new=encoding.fromlocal(new)), f |
241 d = f.value | 241 d = f.value |
242 d, output = d.split('\n', 1) | |
242 try: | 243 try: |
243 d = bool(int(d)) | 244 d = bool(int(d)) |
244 except ValueError: | 245 except ValueError: |
245 raise error.ResponseError( | 246 raise error.ResponseError( |
246 _('push failed (unexpected response):'), d) | 247 _('push failed (unexpected response):'), d) |
248 for l in output.splitlines(True): | |
249 self.ui.status(_('remote: '), l) | |
247 yield d | 250 yield d |
248 | 251 |
249 @batchable | 252 @batchable |
250 def listkeys(self, namespace): | 253 def listkeys(self, namespace): |
251 if not self.capable('pushkey'): | 254 if not self.capable('pushkey'): |