equal
deleted
inserted
replaced
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): |