##// END OF EJS Templates
revert: extract "%ld" formatting in a _formatintlist function...
Boris Feld -
r41256:8d26026b default
parent child Browse files
Show More
@@ -607,7 +607,7 b' def _formatlistexp(s, t):'
607 elif l == 1:
607 elif l == 1:
608 return _formatargtype(t, s[0])
608 return _formatargtype(t, s[0])
609 elif t == 'd':
609 elif t == 'd':
610 return "_intlist('%s')" % "\0".join('%d' % int(a) for a in s)
610 return _formatintlist(s)
611 elif t == 's':
611 elif t == 's':
612 return "_list(%s)" % _quote("\0".join(s))
612 return "_list(%s)" % _quote("\0".join(s))
613 elif t == 'n':
613 elif t == 'n':
@@ -621,6 +621,17 b' def _formatlistexp(s, t):'
621 m = l // 2
621 m = l // 2
622 return '(%s or %s)' % (_formatlistexp(s[:m], t), _formatlistexp(s[m:], t))
622 return '(%s or %s)' % (_formatlistexp(s[:m], t), _formatlistexp(s[m:], t))
623
623
624 def _formatintlist(data):
625 try:
626 l = len(data)
627 if l == 0:
628 return "_list('')"
629 elif l == 1:
630 return _formatargtype('d', data[0])
631 return "_intlist('%s')" % "\0".join('%d' % int(a) for a in data)
632 except (TypeError, ValueError):
633 raise error.ParseError(_('invalid argument for revspec'))
634
624 def _formatparamexp(args, t):
635 def _formatparamexp(args, t):
625 return ', '.join(_formatargtype(t, a) for a in args)
636 return ', '.join(_formatargtype(t, a) for a in args)
626
637
General Comments 0
You need to be logged in to leave comments. Login now