comparison mercurial/dispatch.py @ 36503:8b662717c53f

py3: use bytestr() to coerce position carried by ParseError to string The position value is either int or byte string.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 01 Mar 2018 08:45:34 -0500
parents 976a9fd706ed
children c263c684da91
comparison
equal deleted inserted replaced
36502:faaabe0dc4d1 36503:8b662717c53f
130 if isinstance(inst, error.UnknownIdentifier): 130 if isinstance(inst, error.UnknownIdentifier):
131 # make sure to check fileset first, as revset can invoke fileset 131 # make sure to check fileset first, as revset can invoke fileset
132 similar = _getsimilar(inst.symbols, inst.function) 132 similar = _getsimilar(inst.symbols, inst.function)
133 if len(inst.args) > 1: 133 if len(inst.args) > 1:
134 write(_("hg: parse error at %s: %s\n") % 134 write(_("hg: parse error at %s: %s\n") %
135 (inst.args[1], inst.args[0])) 135 (pycompat.bytestr(inst.args[1]), inst.args[0]))
136 if (inst.args[0][0] == ' '): 136 if (inst.args[0][0] == ' '):
137 write(_("unexpected leading whitespace\n")) 137 write(_("unexpected leading whitespace\n"))
138 else: 138 else:
139 write(_("hg: parse error: %s\n") % inst.args[0]) 139 write(_("hg: parse error: %s\n") % inst.args[0])
140 _reportsimilar(write, similar) 140 _reportsimilar(write, similar)