Show More
@@ -634,15 +634,27 b' def formatspec(expr, *args):' | |||
|
634 | 634 | d = expr[pos] |
|
635 | 635 | if d == '%': |
|
636 | 636 | ret.append(d) |
|
637 | elif d == 'l': | |
|
637 | pos += 1 | |
|
638 | continue | |
|
639 | ||
|
640 | try: | |
|
641 | arg = next(argiter) | |
|
642 | except StopIteration: | |
|
643 | raise error.ParseError(_('missing argument for revspec')) | |
|
644 | if d == 'l': | |
|
638 | 645 | # a list of some type |
|
639 | 646 | pos += 1 |
|
640 | 647 | d = expr[pos] |
|
641 |
ret.append(listexp(list( |
|
|
648 | ret.append(listexp(list(arg), d)) | |
|
642 | 649 | else: |
|
643 |
ret.append(argtype(d, |
|
|
650 | ret.append(argtype(d, arg)) | |
|
644 | 651 | pos += 1 |
|
645 | 652 | |
|
653 | try: | |
|
654 | next(argiter) | |
|
655 | raise error.ParseError(_('too many revspec arguments specified')) | |
|
656 | except StopIteration: | |
|
657 | pass | |
|
646 | 658 | return ''.join(ret) |
|
647 | 659 | |
|
648 | 660 | def prettyformat(tree): |
@@ -4088,6 +4088,15 b' Invalid arguments passed to revset()' | |||
|
4088 | 4088 | $ hg log -T '{revset("%lwhatever", files)}\n' |
|
4089 | 4089 | hg: parse error: unexpected revspec format character w |
|
4090 | 4090 | [255] |
|
4091 | $ hg log -T '{revset("%s %s", 0)}\n' | |
|
4092 | hg: parse error: missing argument for revspec | |
|
4093 | [255] | |
|
4094 | $ hg log -T '{revset("", 0)}\n' | |
|
4095 | hg: parse error: too many revspec arguments specified | |
|
4096 | [255] | |
|
4097 | $ hg log -T '{revset("%s", 0, 1)}\n' | |
|
4098 | hg: parse error: too many revspec arguments specified | |
|
4099 | [255] | |
|
4091 | 4100 | |
|
4092 | 4101 | Test files function |
|
4093 | 4102 |
General Comments 0
You need to be logged in to leave comments.
Login now