Mercurial > hg
changeset 14716:552329013bac stable
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.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Fri, 24 Jun 2011 00:18:41 +0200 |
parents | a97ebfec8c29 |
children | c8ee2729e89f |
files | mercurial/fileset.py |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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())]