# HG changeset patch # User Navaneeth Suresh # Date 2019-02-13 12:47:42 # Node ID 5fe4de392edb1325e8d381295ab4ec8b3f213039 # Parent e21183db2259fe84060c773f06d4307de83c51f7 revset: improve documentation on expectsize() This is a follow-up patch to D5813. It improves the documentation of `expectsize(set, size)`. Differential Revision: https://phab.mercurial-scm.org/D5953 diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -863,7 +863,13 @@ def contentdivergent(repo, subset, x): @predicate('expectsize(set[, size])', safe=True, takeorder=True) def expectsize(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 5 inclusive.""" + args = getargsdict(x, 'expectsize', 'set size') minsize = 0 maxsize = len(repo) + 1