comparison mercurial/revset.py @ 13665:e798e430c5e5

revset: report a parse error if a revset is not parsed completely (issue2654)
author Bernhard Leiner <bleiner@gmail.com>
date Wed, 16 Mar 2011 23:09:14 +0100
parents 54b198fe9768
children 15b97a1cd60b
comparison
equal deleted inserted replaced
13664:53db4e2026ab 13665:e798e430c5e5
821 parse = parser.parser(tokenize, elements).parse 821 parse = parser.parser(tokenize, elements).parse
822 822
823 def match(spec): 823 def match(spec):
824 if not spec: 824 if not spec:
825 raise error.ParseError(_("empty query")) 825 raise error.ParseError(_("empty query"))
826 tree = parse(spec) 826 tree, pos = parse(spec)
827 if (pos != len(spec)):
828 raise error.ParseError("invalid token", pos)
827 weight, tree = optimize(tree, True) 829 weight, tree = optimize(tree, True)
828 def mfunc(repo, subset): 830 def mfunc(repo, subset):
829 return getset(repo, subset, tree) 831 return getset(repo, subset, tree)
830 return mfunc 832 return mfunc
831 833