Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 41698:5fe4de392edb
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
author | Navaneeth Suresh <navaneeths1998@gmail.com> |
---|---|
date | Wed, 13 Feb 2019 18:17:42 +0530 |
parents | 8185c8abce87 |
children | 662ffdde5adf |
comparison
equal
deleted
inserted
replaced
41697:e21183db2259 | 41698:5fe4de392edb |
---|---|
861 contentdivergent = obsmod.getrevs(repo, 'contentdivergent') | 861 contentdivergent = obsmod.getrevs(repo, 'contentdivergent') |
862 return subset & contentdivergent | 862 return subset & contentdivergent |
863 | 863 |
864 @predicate('expectsize(set[, size])', safe=True, takeorder=True) | 864 @predicate('expectsize(set[, size])', safe=True, takeorder=True) |
865 def expectsize(repo, subset, x, order): | 865 def expectsize(repo, subset, x, order): |
866 """Abort if the revset doesn't expect given size""" | 866 """Return the given revset if size matches the revset size. |
867 Abort if the revset doesn't expect given size. | |
868 size can either be an integer range or an integer. | |
869 | |
870 For example, ``expectsize(0:1, 3:5)`` will abort as revset size is 2 and | |
871 2 is not between 3 and 5 inclusive.""" | |
872 | |
867 args = getargsdict(x, 'expectsize', 'set size') | 873 args = getargsdict(x, 'expectsize', 'set size') |
868 minsize = 0 | 874 minsize = 0 |
869 maxsize = len(repo) + 1 | 875 maxsize = len(repo) + 1 |
870 err = '' | 876 err = '' |
871 if 'size' not in args or 'set' not in args: | 877 if 'size' not in args or 'set' not in args: |