##// END OF EJS Templates
automv: switch to specifying the similarity as an integer (0-100)...
Martijn Pieters -
r28152:5ec1ce8f default
parent child Browse files
Show More
@@ -10,7 +10,8 b' This extension checks at commit/amend ti'
10 10 comes from an unrecorded mv.
11 11
12 12 The threshold at which a file is considered a move can be set with the
13 ``automv.similarity`` config option; the default value is 1.00.
13 ``automv.similarity`` config option. This option takes a percentage between 0
14 (disabled) and 100 (files must be identical), the default is 100.
14 15
15 16 """
16 17 from __future__ import absolute_import
@@ -36,11 +37,12 b' def mvcheck(orig, ui, repo, *pats, **opt'
36 37 renames = None
37 38 disabled = opts.pop('no_automv', False)
38 39 if not disabled:
39 threshold = float(ui.config('automv', 'similarity', '1.00'))
40 threshold = float(ui.config('automv', 'similarity', '100'))
40 41 if threshold > 0:
41 42 match = scmutil.match(repo[None], pats, opts)
42 43 added, removed = _interestingfiles(repo, match)
43 renames = _findrenames(repo, match, added, removed, threshold)
44 renames = _findrenames(repo, match, added, removed,
45 threshold / 100.0)
44 46
45 47 with repo.wlock():
46 48 if renames is not None:
General Comments 0
You need to be logged in to leave comments. Login now