Mercurial > public > mercurial-scm > hg-stable
diff mercurial/revset.py @ 14496:ffcb7e4d719f stable
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 | 02a5bebd0dc4 |
children | 4f695345979c |
line wrap: on
line diff
--- 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)