Mercurial > public > mercurial-scm > hg-stable
diff mercurial/parser.py @ 37087:f0b6fbea00cf
stringutil: bulk-replace call sites to point to new module
This might conflict with other patches floating around, sorry.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 22 Mar 2018 21:56:20 +0900 |
parents | 7840d8bd0558 |
children | 0a2ce5b43574 |
line wrap: on
line diff
--- a/mercurial/parser.py Thu Mar 22 21:19:31 2018 +0900 +++ b/mercurial/parser.py Thu Mar 22 21:56:20 2018 +0900 @@ -25,6 +25,9 @@ pycompat, util, ) +from .utils import ( + stringutil, +) class parser(object): def __init__(self, elements, methods=None): @@ -190,14 +193,14 @@ def unescapestr(s): try: - return util.unescapestr(s) + return stringutil.unescapestr(s) except ValueError as e: # mangle Python's exception into our format raise error.ParseError(pycompat.bytestr(e).lower()) def _brepr(obj): if isinstance(obj, bytes): - return b"'%s'" % util.escapestr(obj) + return b"'%s'" % stringutil.escapestr(obj) return encoding.strtolocal(repr(obj)) def _prettyformat(tree, leafnodes, level, lines):