##// END OF EJS Templates
fileset: do not crash by unary negate operation...
Yuya Nishihara -
r35710:a62b08f6 default
parent child Browse files
Show More
@@ -136,6 +136,9 def minusset(mctx, x, y):
136 yl = set(getset(mctx, y))
136 yl = set(getset(mctx, y))
137 return [f for f in xl if f not in yl]
137 return [f for f in xl if f not in yl]
138
138
139 def negateset(mctx, x):
140 raise error.ParseError(_("can't use negate operator in this context"))
141
139 def listset(mctx, a, b):
142 def listset(mctx, a, b):
140 raise error.ParseError(_("can't use a list in this context"),
143 raise error.ParseError(_("can't use a list in this context"),
141 hint=_('see hg help "filesets.x or y"'))
144 hint=_('see hg help "filesets.x or y"'))
@@ -523,6 +526,7 methods = {
523 'and': andset,
526 'and': andset,
524 'or': orset,
527 'or': orset,
525 'minus': minusset,
528 'minus': minusset,
529 'negate': negateset,
526 'list': listset,
530 'list': listset,
527 'group': getset,
531 'group': getset,
528 'not': notset,
532 'not': notset,
@@ -68,6 +68,17 Test invalid syntax
68 None)
68 None)
69 hg: parse error: not a symbol
69 hg: parse error: not a symbol
70 [255]
70 [255]
71 $ fileset -v -- '-x'
72 (negate
73 (symbol 'x'))
74 hg: parse error: can't use negate operator in this context
75 [255]
76 $ fileset -v -- '-()'
77 (negate
78 (group
79 None))
80 hg: parse error: can't use negate operator in this context
81 [255]
71
82
72 Test files status
83 Test files status
73
84
General Comments 0
You need to be logged in to leave comments. Login now