Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/fileset.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 |
---|---|
59 | 59 |
60 def minusmatch(mctx, x, y): | 60 def minusmatch(mctx, x, y): |
61 xm = getmatch(mctx, x) | 61 xm = getmatch(mctx, x) |
62 ym = getmatch(mctx, y) | 62 ym = getmatch(mctx, y) |
63 return matchmod.differencematcher(xm, ym) | 63 return matchmod.differencematcher(xm, ym) |
64 | |
65 def negatematch(mctx, x): | |
66 raise error.ParseError(_("can't use negate operator in this context")) | |
67 | 64 |
68 def listmatch(mctx, *xs): | 65 def listmatch(mctx, *xs): |
69 raise error.ParseError(_("can't use a list in this context"), | 66 raise error.ParseError(_("can't use a list in this context"), |
70 hint=_('see \'hg help "filesets.x or y"\'')) | 67 hint=_('see \'hg help "filesets.x or y"\'')) |
71 | 68 |
434 'symbol': stringmatch, | 431 'symbol': stringmatch, |
435 'kindpat': kindpatmatch, | 432 'kindpat': kindpatmatch, |
436 'and': andmatch, | 433 'and': andmatch, |
437 'or': ormatch, | 434 'or': ormatch, |
438 'minus': minusmatch, | 435 'minus': minusmatch, |
439 'negate': negatematch, | |
440 'list': listmatch, | 436 'list': listmatch, |
441 'not': notmatch, | 437 'not': notmatch, |
442 'func': func, | 438 'func': func, |
443 } | 439 } |
444 | 440 |