Show More
@@ -599,7 +599,10 b' def formatspec(expr, *args):' | |||
|
599 | 599 | elif c == 'n': |
|
600 | 600 | return _quote(node.hex(arg)) |
|
601 | 601 | elif c == 'b': |
|
602 | try: | |
|
602 | 603 | return _quote(arg.branch()) |
|
604 | except AttributeError: | |
|
605 | raise TypeError | |
|
603 | 606 | raise error.ParseError(_('unexpected revspec format character %s') % c) |
|
604 | 607 | |
|
605 | 608 | def listexp(s, t): |
@@ -615,7 +618,10 b' def formatspec(expr, *args):' | |||
|
615 | 618 | elif t == 'n': |
|
616 | 619 | return "_hexlist('%s')" % "\0".join(node.hex(a) for a in s) |
|
617 | 620 | elif t == 'b': |
|
621 | try: | |
|
618 | 622 | return "_list('%s')" % "\0".join(a.branch() for a in s) |
|
623 | except AttributeError: | |
|
624 | raise TypeError | |
|
619 | 625 | |
|
620 | 626 | m = l // 2 |
|
621 | 627 | return '(%s or %s)' % (listexp(s[:m], t), listexp(s[m:], t)) |
@@ -651,9 +657,15 b' def formatspec(expr, *args):' | |||
|
651 | 657 | d = expr[pos] |
|
652 | 658 | except IndexError: |
|
653 | 659 | raise error.ParseError(_('incomplete revspec format character')) |
|
660 | try: | |
|
654 | 661 | ret.append(listexp(list(arg), d)) |
|
662 | except (TypeError, ValueError): | |
|
663 | raise error.ParseError(_('invalid argument for revspec')) | |
|
655 | 664 | else: |
|
665 | try: | |
|
656 | 666 | ret.append(argtype(d, arg)) |
|
667 | except (TypeError, ValueError): | |
|
668 | raise error.ParseError(_('invalid argument for revspec')) | |
|
657 | 669 | pos += 1 |
|
658 | 670 | |
|
659 | 671 | try: |
@@ -4103,6 +4103,24 b' Invalid arguments passed to revset()' | |||
|
4103 | 4103 | $ hg log -T '{revset("%l", 0)}\n' |
|
4104 | 4104 | hg: parse error: incomplete revspec format character |
|
4105 | 4105 | [255] |
|
4106 | $ hg log -T '{revset("%d", 'foo')}\n' | |
|
4107 | hg: parse error: invalid argument for revspec | |
|
4108 | [255] | |
|
4109 | $ hg log -T '{revset("%ld", files)}\n' | |
|
4110 | hg: parse error: invalid argument for revspec | |
|
4111 | [255] | |
|
4112 | $ hg log -T '{revset("%ls", 0)}\n' | |
|
4113 | hg: parse error: invalid argument for revspec | |
|
4114 | [255] | |
|
4115 | $ hg log -T '{revset("%b", 'foo')}\n' | |
|
4116 | hg: parse error: invalid argument for revspec | |
|
4117 | [255] | |
|
4118 | $ hg log -T '{revset("%lb", files)}\n' | |
|
4119 | hg: parse error: invalid argument for revspec | |
|
4120 | [255] | |
|
4121 | $ hg log -T '{revset("%r", 0)}\n' | |
|
4122 | hg: parse error: invalid argument for revspec | |
|
4123 | [255] | |
|
4106 | 4124 | |
|
4107 | 4125 | Test files function |
|
4108 | 4126 |
General Comments 0
You need to be logged in to leave comments.
Login now