Show More
@@ -402,7 +402,7 b' def _intree(funcs, tree):' | |||
|
402 | 402 | def getfileset(ctx, expr): |
|
403 | 403 | tree, pos = parse(expr) |
|
404 | 404 | if (pos != len(expr)): |
|
405 | raise error.ParseError("invalid token", pos) | |
|
405 | raise error.ParseError(_("invalid token"), pos) | |
|
406 | 406 | |
|
407 | 407 | # do we need status info? |
|
408 | 408 | if _intree(['modified', 'added', 'removed', 'deleted', |
@@ -16,6 +16,7 b'' | |||
|
16 | 16 | # __call__(program) parses program into a labelled tree |
|
17 | 17 | |
|
18 | 18 | import error |
|
19 | from i18n import _ | |
|
19 | 20 | |
|
20 | 21 | class parser(object): |
|
21 | 22 | def __init__(self, tokenizer, elements, methods=None): |
@@ -34,7 +35,7 b' class parser(object):' | |||
|
34 | 35 | def _match(self, m, pos): |
|
35 | 36 | 'make sure the tokenizer matches an end condition' |
|
36 | 37 | if self.current[0] != m: |
|
37 | raise error.ParseError("unexpected token: %s" % self.current[0], | |
|
38 | raise error.ParseError(_("unexpected token: %s") % self.current[0], | |
|
38 | 39 | self.current[2]) |
|
39 | 40 | self._advance() |
|
40 | 41 | def _parse(self, bind=0): |
@@ -42,7 +43,7 b' class parser(object):' | |||
|
42 | 43 | # handle prefix rules on current token |
|
43 | 44 | prefix = self._elements[token][1] |
|
44 | 45 | if not prefix: |
|
45 | raise error.ParseError("not a prefix: %s" % token, pos) | |
|
46 | raise error.ParseError(_("not a prefix: %s") % token, pos) | |
|
46 | 47 | if len(prefix) == 1: |
|
47 | 48 | expr = (prefix[0], value) |
|
48 | 49 | else: |
@@ -64,7 +65,7 b' class parser(object):' | |||
|
64 | 65 | else: |
|
65 | 66 | # handle infix rules |
|
66 | 67 | if len(e) < 3 or not e[2]: |
|
67 | raise error.ParseError("not an infix: %s" % token, pos) | |
|
68 | raise error.ParseError(_("not an infix: %s") % token, pos) | |
|
68 | 69 | infix = e[2] |
|
69 | 70 | if len(infix) == 3 and infix[2] == self.current[0]: |
|
70 | 71 | self._match(infix[2], pos) |
@@ -979,7 +979,7 b' class revsetalias(object):' | |||
|
979 | 979 | value = value.replace(arg, repr(arg)) |
|
980 | 980 | self.replacement, pos = parse(value) |
|
981 | 981 | if pos != len(value): |
|
982 | raise error.ParseError('invalid token', pos) | |
|
982 | raise error.ParseError(_('invalid token'), pos) | |
|
983 | 983 | else: |
|
984 | 984 | self.replacement = value |
|
985 | 985 | |
@@ -997,7 +997,8 b' class revsetalias(object):' | |||
|
997 | 997 | (len(self.args) == 1 and tree[2][0] == 'list') or |
|
998 | 998 | (len(self.args) > 1 and (tree[2][0] != 'list' or |
|
999 | 999 | len(tree[2]) - 1 != len(self.args)))): |
|
1000 |
raise error.ParseError('invalid amount of arguments', |
|
|
1000 | raise error.ParseError(_('invalid amount of arguments'), | |
|
1001 | len(tree) - 2) | |
|
1001 | 1002 | return True |
|
1002 | 1003 | |
|
1003 | 1004 | def replace(self, tree): |
@@ -1033,7 +1034,7 b' def match(ui, spec):' | |||
|
1033 | 1034 | raise error.ParseError(_("empty query")) |
|
1034 | 1035 | tree, pos = parse(spec) |
|
1035 | 1036 | if (pos != len(spec)): |
|
1036 | raise error.ParseError("invalid token", pos) | |
|
1037 | raise error.ParseError(_("invalid token"), pos) | |
|
1037 | 1038 | tree = findaliases(ui, tree) |
|
1038 | 1039 | weight, tree = optimize(tree, True) |
|
1039 | 1040 | def mfunc(repo, subset): |
General Comments 0
You need to be logged in to leave comments.
Login now