revset: add expectsize to check the size of a set

Authored by navaneeth.suresh.

Description

revset: add expectsize to check the size of a set

expectsize(<set>, <int>) revset fails if <set> is not exactly <int>
elements. expectsize(<set>, <min>:<max>) revset fails if <set> is not
exactly between <min> and <max> inclusive.

This then allows an alias for hg next to be update -r one(children(.))
with sane failure behavior, and also makes some other scripting tasks
a little less difficult.

(Summary from WeShouldDoThat)

Differential Revision: https://phab.mercurial-scm.org/D5813

Details

Committed
navaneeth.sureshFeb 3 2019, 8:40 AM
Differential Revision
D5813: revset: add expect to check the size of a set
Parents
rHG91701785c2c5: merge with stable
Branches
Unknown
Tags
Unknown