comparison 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
comparison
equal deleted inserted replaced
4965:4106dde15aed 4967:cf67b5f3743d
51 this compares every removed file with every added file and records 51 this compares every removed file with every added file and records
52 those similar enough as renames. This option takes a percentage 52 those similar enough as renames. This option takes a percentage
53 between 0 (disabled) and 100 (files must be identical) as its 53 between 0 (disabled) and 100 (files must be identical) as its
54 parameter. Detecting renamed files this way can be expensive. 54 parameter. Detecting renamed files this way can be expensive.
55 """ 55 """
56 sim = float(opts.get('similarity') or 0) 56 try:
57 sim = float(opts.get('similarity') or 0)
58 except ValueError:
59 raise util.Abort(_('similarity must be a number'))
57 if sim < 0 or sim > 100: 60 if sim < 0 or sim > 100:
58 raise util.Abort(_('similarity must be between 0 and 100')) 61 raise util.Abort(_('similarity must be between 0 and 100'))
59 return cmdutil.addremove(repo, pats, opts, similarity=sim/100.) 62 return cmdutil.addremove(repo, pats, opts, similarity=sim/100.)
60 63
61 def annotate(ui, repo, *pats, **opts): 64 def annotate(ui, repo, *pats, **opts):