D5953: revset: improve documentation on expectsize()
navaneeth.suresh (Navaneeth Suresh)
phabricator at mercurial-scm.org
Wed Feb 13 12:51:02 UTC 2019
navaneeth.suresh created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
This is a follow-up patch to https://phab.mercurial-scm.org/D5813. It improves the documentation of
`expectsize(set, size)`.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D5953
AFFECTED FILES
mercurial/revset.py
CHANGE DETAILS
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -817,7 +817,12 @@
@predicate('expectsize(set[, size])', safe=True, takeorder=True)
def expectrevsetsize(repo, subset, x, order):
- """Abort if the revset doesn't expect given size"""
+ """Return the given revset if size matches the revset size.
+ Abort if the revset doesn't expect given size.
+ size can either be an integer range or an integer.
+
+ For example, ``expectsize(0:1, 3:5)`` will abort as revset size is 2 and
+ 2 is not between 3 and 4 inclusive."""
args = getargsdict(x, 'expect', 'set size')
minsize = 0
maxsize = len(repo)+1
To: navaneeth.suresh, #hg-reviewers
Cc: mjpieters, mercurial-devel
More information about the Mercurial-devel
mailing list