Show More
@@ -103,7 +103,7 b' def parse(expr):' | |||||
103 | tree, pos = p.parse(tokenize(expr)) |
|
103 | tree, pos = p.parse(tokenize(expr)) | |
104 | if pos != len(expr): |
|
104 | if pos != len(expr): | |
105 | raise error.ParseError(_("invalid token"), pos) |
|
105 | raise error.ParseError(_("invalid token"), pos) | |
106 | return tree |
|
106 | return parser.simplifyinfixops(tree, {'list'}) | |
107 |
|
107 | |||
108 | def getsymbol(x): |
|
108 | def getsymbol(x): | |
109 | if x and x[0] == 'symbol': |
|
109 | if x and x[0] == 'symbol': | |
@@ -131,7 +131,7 b' def getlist(x):' | |||||
131 | if not x: |
|
131 | if not x: | |
132 | return [] |
|
132 | return [] | |
133 | if x[0] == 'list': |
|
133 | if x[0] == 'list': | |
134 |
return |
|
134 | return list(x[1:]) | |
135 | return [x] |
|
135 | return [x] | |
136 |
|
136 | |||
137 | def getargs(x, min, max, err): |
|
137 | def getargs(x, min, max, err): | |
@@ -174,7 +174,7 b' def minusmatch(mctx, x, y):' | |||||
174 | def negatematch(mctx, x): |
|
174 | def negatematch(mctx, x): | |
175 | raise error.ParseError(_("can't use negate operator in this context")) |
|
175 | raise error.ParseError(_("can't use negate operator in this context")) | |
176 |
|
176 | |||
177 |
def listmatch(mctx, |
|
177 | def listmatch(mctx, *xs): | |
178 | raise error.ParseError(_("can't use a list in this context"), |
|
178 | raise error.ParseError(_("can't use a list in this context"), | |
179 | hint=_('see hg help "filesets.x or y"')) |
|
179 | hint=_('see hg help "filesets.x or y"')) | |
180 |
|
180 |
@@ -111,6 +111,15 b' Test invalid syntax' | |||||
111 | None)) |
|
111 | None)) | |
112 | hg: parse error: can't use negate operator in this context |
|
112 | hg: parse error: can't use negate operator in this context | |
113 | [255] |
|
113 | [255] | |
|
114 | $ fileset -p parsed 'a, b, c' | |||
|
115 | * parsed: | |||
|
116 | (list | |||
|
117 | (symbol 'a') | |||
|
118 | (symbol 'b') | |||
|
119 | (symbol 'c')) | |||
|
120 | hg: parse error: can't use a list in this context | |||
|
121 | (see hg help "filesets.x or y") | |||
|
122 | [255] | |||
114 |
|
123 | |||
115 | $ fileset '"path":.' |
|
124 | $ fileset '"path":.' | |
116 | hg: parse error: not a symbol |
|
125 | hg: parse error: not a symbol |
General Comments 0
You need to be logged in to leave comments.
Login now