Mercurial > public > mercurial-scm > python-hglib
annotate hglib/error.py @ 216:68588c652ac6
client: handle commit messages with \0 characters
Mercurial allows commit messages containing \0 characters,
but hglib does not properly handle them.
By using the json template, these characters are correctly escaped.
Note: initial change only modifies this for the 'log' command,
I'll follow-up for other commands if this is ok.
author | Mathias De Mare <mathias.de_mare@nokia.com> |
---|---|
date | Wed, 08 Mar 2023 16:22:21 +0100 |
parents | 59cb26bf866e |
children |
rev | line source |
---|---|
0 | 1 class CommandError(Exception): |
2 def __init__(self, args, ret, out, err): | |
3 self.args = args | |
4 self.ret = ret | |
5 self.out = out | |
6 self.err = err | |
7 | |
36
00bb0701323a
error: return stderr as __str__ for CommandError
Idan Kamara <idankk86@gmail.com>
parents:
0
diff
changeset
|
8 def __str__(self): |
117
59cb26bf866e
error: show more info on CommandError's __str__
Idan Kamara <idankk86@gmail.com>
parents:
36
diff
changeset
|
9 return str((self.ret, self.out.rstrip(), self.err.rstrip())) |
36
00bb0701323a
error: return stderr as __str__ for CommandError
Idan Kamara <idankk86@gmail.com>
parents:
0
diff
changeset
|
10 |
0 | 11 class ServerError(Exception): |
12 pass | |
13 | |
14 class ResponseError(ServerError, ValueError): | |
15 pass | |
16 | |
17 class CapabilityError(ServerError): | |
18 pass |