comparison mercurial/filesetlang.py @ 38868:3ea6ce609747

fileset: reject 'negate' node early while transforming parsed tree That's how a 'negate' node is processed in revset.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 21 Jul 2018 16:16:44 +0900
parents 48fc2a8af345
children 7e7e2b2ff284
comparison
equal deleted inserted replaced
38867:48fc2a8af345 38868:3ea6ce609747
142 getsymbol(x[1]) # kind must be a symbol 142 getsymbol(x[1]) # kind must be a symbol
143 t = _analyze(x[2]) 143 t = _analyze(x[2])
144 return (op, x[1], t) 144 return (op, x[1], t)
145 if op == 'group': 145 if op == 'group':
146 return _analyze(x[1]) 146 return _analyze(x[1])
147 if op in {'not', 'negate'}: 147 if op == 'negate':
148 raise error.ParseError(_("can't use negate operator in this context"))
149 if op == 'not':
148 t = _analyze(x[1]) 150 t = _analyze(x[1])
149 return (op, t) 151 return (op, t)
150 if op in {'and', 'minus'}: 152 if op in {'and', 'minus'}:
151 ta = _analyze(x[1]) 153 ta = _analyze(x[1])
152 tb = _analyze(x[2]) 154 tb = _analyze(x[2])