changeset 36535:db33c5bc781f

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".
author Yuya Nishihara <yuya@tcha.org>
date Thu, 01 Mar 2018 04:50:22 -0500
parents b075f45456a5
children 74c033b9d579
files mercurial/fileset.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/fileset.py	Thu Mar 01 08:55:39 2018 -0500
+++ b/mercurial/fileset.py	Thu Mar 01 04:50:22 2018 -0500
@@ -392,11 +392,10 @@
     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):