From patchwork Thu Feb 14 13:24:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D5953: revset: improve documentation on expectsize() From: phabricator X-Patchwork-Id: 38743 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Thu, 14 Feb 2019 13:24:07 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHG735da363556d: revset: improve documentation on expectsize() (authored by navaneeth.suresh, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D5953?vs=14068&id=14087#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5953?vs=14068&id=14087 REVISION DETAIL https://phab.mercurial-scm.org/D5953 AFFECTED FILES mercurial/revset.py CHANGE DETAILS To: navaneeth.suresh, #hg-reviewers, pulkit Cc: mjpieters, mercurial-devel diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -863,7 +863,13 @@ @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