diff -r c63cc5eccbff -r ffcb7e4d719f mercurial/revset.py --- a/mercurial/revset.py Tue May 31 15:25:43 2011 -0500 +++ b/mercurial/revset.py Wed Mar 16 23:09:14 2011 +0100 @@ -810,7 +810,9 @@ def match(spec): if not spec: raise error.ParseError(_("empty query")) - tree = parse(spec) + tree, pos = parse(spec) + if (pos != len(spec)): + raise error.ParseError("invalid token", pos) weight, tree = optimize(tree, True) def mfunc(repo, subset): return getset(repo, subset, tree)