revset: nicer exception for empty queries
authorMatt Mackall <mpm@selenic.com>
Fri, 18 Jun 2010 17:34:13 -0500
changeset 11385 e5a2134c083b
parent 11384 c04084753990
child 11387 181936ec9bfb
revset: nicer exception for empty queries
mercurial/revset.py
--- a/mercurial/revset.py	Fri Jun 18 21:35:21 2010 +0200
+++ b/mercurial/revset.py	Fri Jun 18 17:34:13 2010 -0500
@@ -546,6 +546,8 @@
 parse = parser.parser(tokenize, elements).parse
 
 def match(spec):
+    if not spec:
+        raise error.ParseError(_("empty query"))
     tree = parse(spec)
     weight, tree = optimize(tree, True)
     def mfunc(repo, subset):