diff --git a/mercurial/fileset.py b/mercurial/fileset.py --- a/mercurial/fileset.py +++ b/mercurial/fileset.py @@ -287,7 +287,7 @@ def grep(mctx, x): def _sizetomax(s): try: - s = s.strip() + s = s.strip().lower() for k, v in util._sizeunits: if s.endswith(k): # max(4k) = 5k - 1, max(4.5k) = 4.6k - 1 diff --git a/tests/test-fileset.t b/tests/test-fileset.t --- a/tests/test-fileset.t +++ b/tests/test-fileset.t @@ -144,6 +144,8 @@ Test files properties 2k $ fileset '(1k or 2k) and size(".5KB - 1.5kB")' 1k + $ fileset 'size("1M")' + $ fileset 'size("1 GB")' Test merge states