fileset: use ParseError pos field correctly stable
authorMads Kiilerich <mads@kiilerich.com>
Fri, 24 Jun 2011 00:18:41 +0200
branchstable
changeset 14716 552329013bac
parent 14715 a97ebfec8c29
child 14717 c8ee2729e89f
fileset: use ParseError pos field correctly The pos field is intended to describe the position of the error - it should not be used for other potentially interesting information.
mercurial/fileset.py
--- a/mercurial/fileset.py	Fri Jun 24 00:18:06 2011 +0200
+++ b/mercurial/fileset.py	Fri Jun 24 00:18:41 2011 +0200
@@ -254,8 +254,7 @@
                 return int(float(s[:-len(k)]) * v)
         return int(s)
     except ValueError:
-        raise
-        raise error.ParseError(_("couldn't parse size"), s)
+        raise error.ParseError(_("couldn't parse size: %s") % s)
 
 def _sizetomax(s):
     try:
@@ -271,8 +270,7 @@
         # no extension, this is a precise value
         return int(s)
     except ValueError:
-        raise
-        raise error.ParseError(_("couldn't parse size"), s)
+        raise error.ParseError(_("couldn't parse size: %s") % s)
 
 def size(mctx, x):
     """``size(expression)``
@@ -307,7 +305,7 @@
         b = _sizetomax(expr)
         m = lambda x: x >= a and x <= b
     else:
-        raise error.ParseError(_("couldn't parse size"), expr)
+        raise error.ParseError(_("couldn't parse size: %s") % expr)
 
     return [f for f in mctx.subset if m(mctx.ctx[f].size())]