martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers.
REVISION SUMMARY 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(). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3713 AFFECTED FILES mercurial/revset.py tests/test-revset2.t CHANGE DETAILS diff --git a/tests/test-revset2.t b/tests/test-revset2.t --- a/tests/test-revset2.t +++ b/tests/test-revset2.t @@ -584,6 +584,9 @@ hg: parse error: empty string is not a valid revision [255] +test empty revset + $ hg log 'none()' + we can use patterns when searching for tags $ log 'tag("1..*")' diff --git a/mercurial/revset.py b/mercurial/revset.py --- 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.""" To: martinvonz, #hg-reviewers Cc: mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel