# HG changeset patch # User Augie Fackler # Date 1489900459 14400 # Node ID 7eac6fcf2ffaf24e91efd9f37d4c2f2407c1e571 # Parent fbe8502c4480b83b5bc1ddc72c83e2dc0230617e revsetlang: move quoting function to not be a closure I'm about to change the implementation here and I'd like to add some doctests, which means this needs to not be hidden inside another function. diff -r fbe8502c4480 -r 7eac6fcf2ffa mercurial/revsetlang.py --- a/mercurial/revsetlang.py Thu Mar 23 10:33:20 2017 -0400 +++ b/mercurial/revsetlang.py Sun Mar 19 01:14:19 2017 -0400 @@ -573,6 +573,9 @@ def parse(spec, lookup=None): return _parsewith(spec, lookup=lookup) +def _quote(s): + return repr(str(s)) + def formatspec(expr, *args): ''' This is a convenience function for using revsets internally, and @@ -606,21 +609,18 @@ "root(_list('a\\x00b\\x00c\\x00d'))" ''' - def quote(s): - return repr(str(s)) - def argtype(c, arg): if c == 'd': return '%d' % int(arg) elif c == 's': - return quote(arg) + return _quote(arg) elif c == 'r': parse(arg) # make sure syntax errors are confined return '(%s)' % arg elif c == 'n': - return quote(node.hex(arg)) + return _quote(node.hex(arg)) elif c == 'b': - return quote(arg.branch()) + return _quote(arg.branch()) def listexp(s, t): l = len(s)