revset: document the `revset(...)` syntax
authorBoris Feld <boris.feld@octobus.net>
Thu, 11 Oct 2018 03:13:53 +0200
changeset 40310 d894d2372ffe
parent 40309 1bd3e922de18
child 40311 4aa04d009167
revset: document the `revset(...)` syntax We introduce a new "no-op" function to bear the documentation. In practice, the parsing step is skipping it so it is not even called. This will get fixed in the next changeset.
mercurial/revset.py
--- a/mercurial/revset.py	Tue Oct 16 12:39:21 2018 +0200
+++ b/mercurial/revset.py	Thu Oct 11 03:13:53 2018 +0200
@@ -1751,6 +1751,16 @@
         return baseset()
     return subset & baseset([l])
 
+@predicate('revset(set)', safe=True, takeorder=True)
+def revsetpredicate(repo, subset, x, order):
+    """Strictly interpret the content as a revset.
+
+    The content of this special predicate will be strictly interpreted as a
+    revset. For example, ``revset(id(0))`` will be interpreted as "id(0)"
+    without possible ambiguity with a "id(0)" bookmark or tag.
+    """
+    return getset(repo, subset, x, order)
+
 @predicate('matching(revision [, field])', safe=True)
 def matching(repo, subset, x):
     """Changesets in which a given set of fields match the set of fields in the