Mercurial > hg > mercurial-source
diff mercurial/parser.py @ 29470:639e0f1e8ffa
parser: move parsererrordetail() function from revset module
This will be used by common alias functions introduced by future patches.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 29 Feb 2016 17:02:56 +0900 |
parents | 87c9c562c37a |
children | 475dad3432fd |
line wrap: on
line diff
--- a/mercurial/parser.py +++ b/mercurial/parser.py @@ -220,3 +220,11 @@ simplified.append(simplifyinfixops(x, targetnodes)) simplified.append(op) return tuple(reversed(simplified)) + +def parseerrordetail(inst): + """Compose error message from specified ParseError object + """ + if len(inst.args) > 1: + return _('at %s: %s') % (inst.args[1], inst.args[0]) + else: + return inst.args[0]