Mercurial > public > mercurial-scm > hg
diff mercurial/minifileset.py @ 38687:1500cbe22d53
fileset: parse argument of size() by predicate function
This change is necessary to pass in a size expression to predicatematcher.
See the next patch.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 10 Jun 2018 20:58:10 +0900 |
parents | 9c98cb30f4de |
children | d82c4d42b615 |
line wrap: on
line diff
--- a/mercurial/minifileset.py Sun Jun 10 22:19:56 2018 +0900 +++ b/mercurial/minifileset.py Sun Jun 10 20:58:10 2018 +0900 @@ -14,6 +14,11 @@ pycompat, ) +def _sizep(x): + # i18n: "size" is a keyword + expr = fileset.getstring(x, _("size requires an expression")) + return fileset.sizematcher(expr) + def _compile(tree): if not tree: raise error.ParseError(_("missing argument")) @@ -50,7 +55,7 @@ symbols = { 'all': lambda n, s: True, 'none': lambda n, s: False, - 'size': lambda n, s: fileset.sizematcher(tree[2])(s), + 'size': lambda n, s: _sizep(tree[2])(s), } name = fileset.getsymbol(tree[1])