Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 11385:e5a2134c083b
revset: nicer exception for empty queries
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 18 Jun 2010 17:34:13 -0500 |
parents | de544774ebea |
children | 37cbedbeae96 |
comparison
equal
deleted
inserted
replaced
11384:c04084753990 | 11385:e5a2134c083b |
---|---|
544 return 1, x | 544 return 1, x |
545 | 545 |
546 parse = parser.parser(tokenize, elements).parse | 546 parse = parser.parser(tokenize, elements).parse |
547 | 547 |
548 def match(spec): | 548 def match(spec): |
549 if not spec: | |
550 raise error.ParseError(_("empty query")) | |
549 tree = parse(spec) | 551 tree = parse(spec) |
550 weight, tree = optimize(tree, True) | 552 weight, tree = optimize(tree, True) |
551 def mfunc(repo, subset): | 553 def mfunc(repo, subset): |
552 return getset(repo, subset, tree) | 554 return getset(repo, subset, tree) |
553 return mfunc | 555 return mfunc |