Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 4967:cf67b5f3743d
merge with crew-stable
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Sun, 22 Jul 2007 09:45:18 +0200 |
parents | 4106dde15aed 8d982aef0be1 |
children | c0417a319e39 1d0bfa4c75c0 |
line wrap: on
line diff
--- a/mercurial/commands.py Sat Jul 21 16:44:38 2007 -0500 +++ b/mercurial/commands.py Sun Jul 22 09:45:18 2007 +0200 @@ -53,7 +53,10 @@ between 0 (disabled) and 100 (files must be identical) as its parameter. Detecting renamed files this way can be expensive. """ - sim = float(opts.get('similarity') or 0) + try: + sim = float(opts.get('similarity') or 0) + except ValueError: + raise util.Abort(_('similarity must be a number')) if sim < 0 or sim > 100: raise util.Abort(_('similarity must be between 0 and 100')) return cmdutil.addremove(repo, pats, opts, similarity=sim/100.)