Mercurial > public > mercurial-scm > hg-stable
diff mercurial/dispatch.py @ 45799:0fc8b066928a
errors: name arguments to ParseError constructor
As with similar previous patches, this is to improve readability.
Differential Revision: https://phab.mercurial-scm.org/D9240
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 22 Oct 2020 09:58:05 -0700 |
parents | d2e1dcd4490d |
children | 0883413e09bc |
line wrap: on
line diff
--- a/mercurial/dispatch.py Tue Oct 20 08:58:20 2020 -0700 +++ b/mercurial/dispatch.py Thu Oct 22 09:58:05 2020 -0700 @@ -243,15 +243,15 @@ if isinstance(inst, error.UnknownIdentifier): # make sure to check fileset first, as revset can invoke fileset similar = _getsimilar(inst.symbols, inst.function) - if len(inst.args) > 1: + if inst.location is not None: write( _(b"hg: parse error at %s: %s\n") - % (pycompat.bytestr(inst.args[1]), inst.args[0]) + % (pycompat.bytestr(inst.location), inst.message) ) - if inst.args[0].startswith(b' '): + if inst.message.startswith(b' '): write(_(b"unexpected leading whitespace\n")) else: - write(_(b"hg: parse error: %s\n") % inst.args[0]) + write(_(b"hg: parse error: %s\n") % inst.message) _reportsimilar(write, similar) if inst.hint: write(_(b"(%s)\n") % inst.hint)