revsetlang: perform quoting using ui.escapestr instead of repr()
This changes one of the doctest results, but I'm pretty sure on
inspection that it's an equivalent result.
--- a/mercurial/revsetlang.py Thu Mar 23 10:41:34 2017 -0400
+++ b/mercurial/revsetlang.py Thu Mar 23 10:46:50 2017 -0400
@@ -15,6 +15,7 @@
node,
parser,
pycompat,
+ util,
)
elements = {
@@ -581,11 +582,11 @@
>>> _quote("asdf'\"")
'\'asdf\\\'"\''
>>> _quote('asdf\'')
- '"asdf\'"'
+ "'asdf\\''"
>>> _quote(1)
"'1'"
"""
- return repr(str(s))
+ return "'%s'" % util.escapestr('%s' % s)
def formatspec(expr, *args):
'''