D3713: revsets: define a none() revset

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Jun 12 08:26:37 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf1d55ae2c5c8: revsets: define a none() revset (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3713?vs=9012&id=9017

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
 
+ at 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


More information about the Mercurial-devel mailing list