diff -r 7eac6fcf2ffa -r 0b94c19b641c mercurial/revsetlang.py --- a/mercurial/revsetlang.py Sun Mar 19 01:14:19 2017 -0400 +++ b/mercurial/revsetlang.py Thu Mar 23 10:41:34 2017 -0400 @@ -574,6 +574,17 @@ return _parsewith(spec, lookup=lookup) def _quote(s): + r"""Quote a value in order to make it safe for the revset engine. + + >>> _quote('asdf') + "'asdf'" + >>> _quote("asdf'\"") + '\'asdf\\\'"\'' + >>> _quote('asdf\'') + '"asdf\'"' + >>> _quote(1) + "'1'" + """ return repr(str(s)) def formatspec(expr, *args):