##// END OF EJS Templates
revsetlang: add docstring with some tests to _quote
Augie Fackler -
r31605:0b94c19b default
parent child Browse files
Show More
@@ -574,6 +574,17 b' def parse(spec, lookup=None):'
574 return _parsewith(spec, lookup=lookup)
574 return _parsewith(spec, lookup=lookup)
575
575
576 def _quote(s):
576 def _quote(s):
577 r"""Quote a value in order to make it safe for the revset engine.
578
579 >>> _quote('asdf')
580 "'asdf'"
581 >>> _quote("asdf'\"")
582 '\'asdf\\\'"\''
583 >>> _quote('asdf\'')
584 '"asdf\'"'
585 >>> _quote(1)
586 "'1'"
587 """
577 return repr(str(s))
588 return repr(str(s))
578
589
579 def formatspec(expr, *args):
590 def formatspec(expr, *args):
General Comments 0
You need to be logged in to leave comments. Login now