diff --git a/mercurial/wireprotoframing.py b/mercurial/wireprotoframing.py --- a/mercurial/wireprotoframing.py +++ b/mercurial/wireprotoframing.py @@ -419,6 +419,8 @@ payload=b'') def createcommanderrorresponse(stream, requestid, message, args=None): + # TODO should this be using a list of {'msg': ..., 'args': {}} so atom + # formatting works consistently? m = { b'status': b'error', b'error': { diff --git a/mercurial/wireprotov2peer.py b/mercurial/wireprotov2peer.py --- a/mercurial/wireprotov2peer.py +++ b/mercurial/wireprotov2peer.py @@ -27,7 +27,7 @@ msg = _(atom[b'msg']) if b'args' in atom: - msg = msg % atom[b'args'] + msg = msg % tuple(atom[b'args']) chunks.append(msg) @@ -163,8 +163,10 @@ if overall['status'] == 'ok': self._futures[frame.requestid].set_result(decoder(objs)) else: - e = error.RepoError( - formatrichmessage(overall['error']['message'])) + atoms = [{'msg': overall['error']['message']}] + if 'args' in overall['error']: + atoms[0]['args'] = overall['error']['args'] + e = error.RepoError(formatrichmessage(atoms)) self._futures[frame.requestid].set_exception(e) else: self._futures[frame.requestid].set_result(response)