mercurial/revsetlang.py
changeset 31605 0b94c19b641c
parent 31604 7eac6fcf2ffa
child 31606 0b3eb280564b
--- 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):