diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2152,6 +2152,10 @@ """Create a matcher for a single revision spec""" return matchany(ui, [spec], repo=repo) +def emptymatcher(repo, subset=None): + """ Matcher for empty specs """ + return baseset() + def matchany(ui, specs, repo=None, localalias=None): """Create a matcher that will include any revisions matching one of the given specs @@ -2160,9 +2164,7 @@ precedence over [revsetalias] config section. """ if not specs: - def mfunc(repo, subset=None): - return baseset() - return mfunc + return emptymatcher if not all(specs): raise error.ParseError(_("empty query")) lookup = None