Show More
@@ -573,6 +573,9 def foldconcat(tree): | |||||
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): | |||
|
577 | return repr(str(s)) | |||
|
578 | ||||
576 | def formatspec(expr, *args): |
|
579 | def formatspec(expr, *args): | |
577 | ''' |
|
580 | ''' | |
578 | This is a convenience function for using revsets internally, and |
|
581 | This is a convenience function for using revsets internally, and | |
@@ -606,21 +609,18 def formatspec(expr, *args): | |||||
606 | "root(_list('a\\x00b\\x00c\\x00d'))" |
|
609 | "root(_list('a\\x00b\\x00c\\x00d'))" | |
607 | ''' |
|
610 | ''' | |
608 |
|
611 | |||
609 | def quote(s): |
|
|||
610 | return repr(str(s)) |
|
|||
611 |
|
||||
612 | def argtype(c, arg): |
|
612 | def argtype(c, arg): | |
613 | if c == 'd': |
|
613 | if c == 'd': | |
614 | return '%d' % int(arg) |
|
614 | return '%d' % int(arg) | |
615 | elif c == 's': |
|
615 | elif c == 's': | |
616 | return quote(arg) |
|
616 | return _quote(arg) | |
617 | elif c == 'r': |
|
617 | elif c == 'r': | |
618 | parse(arg) # make sure syntax errors are confined |
|
618 | parse(arg) # make sure syntax errors are confined | |
619 | return '(%s)' % arg |
|
619 | return '(%s)' % arg | |
620 | elif c == 'n': |
|
620 | elif c == 'n': | |
621 | return quote(node.hex(arg)) |
|
621 | return _quote(node.hex(arg)) | |
622 | elif c == 'b': |
|
622 | elif c == 'b': | |
623 | return quote(arg.branch()) |
|
623 | return _quote(arg.branch()) | |
624 |
|
624 | |||
625 | def listexp(s, t): |
|
625 | def listexp(s, t): | |
626 | l = len(s) |
|
626 | l = len(s) |
General Comments 0
You need to be logged in to leave comments.
Login now