comparison mercurial/revset.py @ 40310:d894d2372ffe

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.
author Boris Feld <boris.feld@octobus.net>
date Thu, 11 Oct 2018 03:13:53 +0200
parents 85a474adaf26
children 7ed611c60168
comparison
equal deleted inserted replaced
40309:1bd3e922de18 40310:d894d2372ffe
1749 raise error.ParseError(_("rev expects a number")) 1749 raise error.ParseError(_("rev expects a number"))
1750 if l not in repo.changelog and l not in (node.nullrev, node.wdirrev): 1750 if l not in repo.changelog and l not in (node.nullrev, node.wdirrev):
1751 return baseset() 1751 return baseset()
1752 return subset & baseset([l]) 1752 return subset & baseset([l])
1753 1753
1754 @predicate('revset(set)', safe=True, takeorder=True)
1755 def revsetpredicate(repo, subset, x, order):
1756 """Strictly interpret the content as a revset.
1757
1758 The content of this special predicate will be strictly interpreted as a
1759 revset. For example, ``revset(id(0))`` will be interpreted as "id(0)"
1760 without possible ambiguity with a "id(0)" bookmark or tag.
1761 """
1762 return getset(repo, subset, x, order)
1763
1754 @predicate('matching(revision [, field])', safe=True) 1764 @predicate('matching(revision [, field])', safe=True)
1755 def matching(repo, subset, x): 1765 def matching(repo, subset, x):
1756 """Changesets in which a given set of fields match the set of fields in the 1766 """Changesets in which a given set of fields match the set of fields in the
1757 selected revision or set. 1767 selected revision or set.
1758 1768