# HG changeset patch # User Yuya Nishihara # Date 2018-03-01 09:50:22 # Node ID db33c5bc781ff17019379dabd76bcd4c07e590f1 # Parent b075f45456a59a3e9a250039ac6087ac424a26c2 fileset: drop bad "elif:" trying to check invalid size expression Since str.isdigit is a function, the last "elif" was always true. An invalid expression is rejected by util.sizetoint(), so we don't need "elif". diff --git a/mercurial/fileset.py b/mercurial/fileset.py --- a/mercurial/fileset.py +++ b/mercurial/fileset.py @@ -392,11 +392,10 @@ def sizematcher(x): elif expr.startswith(">"): a = util.sizetoint(expr[1:]) return lambda x: x > a - elif expr[0:1].isdigit or expr.startswith('.'): + else: a = util.sizetoint(expr) b = _sizetomax(expr) return lambda x: x >= a and x <= b - raise error.ParseError(_("couldn't parse size: %s") % expr) @predicate('size(expression)', callexisting=True) def size(mctx, x):