diff 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
line wrap: on
line diff
--- a/mercurial/filesetlang.py	Sat Jul 21 16:13:30 2018 +0900
+++ b/mercurial/filesetlang.py	Sat Jul 21 16:16:44 2018 +0900
@@ -144,7 +144,9 @@
         return (op, x[1], t)
     if op == 'group':
         return _analyze(x[1])
-    if op in {'not', 'negate'}:
+    if op == 'negate':
+        raise error.ParseError(_("can't use negate operator in this context"))
+    if op == 'not':
         t = _analyze(x[1])
         return (op, t)
     if op in {'and', 'minus'}: