mercurial/revsetlang.py
changeset 31605 0b94c19b641c
parent 31604 7eac6fcf2ffa
child 31606 0b3eb280564b
equal deleted inserted replaced
31604:7eac6fcf2ffa 31605:0b94c19b641c
   572 
   572 
   573 def parse(spec, lookup=None):
   573 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):
   580     '''
   591     '''
   581     This is a convenience function for using revsets internally, and
   592     This is a convenience function for using revsets internally, and