Mercurial > hg > mercurial-source
changeset 39061:f1d55ae2c5c8
revsets: define a none() revset
This can be useful for default values in corp-wide configuration
(e.g. for commits to hide, which defaults to none()), and perhaps in
scripts. I named it none() rather than empty() to match all().
Differential Revision: https://phab.mercurial-scm.org/D3713
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 11 Jun 2018 11:37:21 -0700 (2018-06-11) |
parents | 99188a7c8717 |
children | fa4a286410a5 |
files | mercurial/revset.py tests/test-revset2.t |
diffstat | 2 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1346,6 +1346,14 @@ result = baseset([rn]) return result & subset +@predicate('none()', safe=True) +def none(repo, subset, x): + """No changesets. + """ + # i18n: "none" is a keyword + getargs(x, 0, 0, _("none takes no arguments")) + return baseset() + @predicate('obsolete()', safe=True) def obsolete(repo, subset, x): """Mutable changeset with a newer version."""