Show More
@@ -32,6 +32,7 b' def extsetup(ui):' | |||
|
32 | 32 | _('disable automatic file move detection'))) |
|
33 | 33 | |
|
34 | 34 | def mvcheck(orig, ui, repo, *pats, **opts): |
|
35 | """Hook to check for moves at commit time""" | |
|
35 | 36 | disabled = opts.pop('no_automv', False) |
|
36 | 37 | if not disabled: |
|
37 | 38 | threshold = float(ui.config('automv', 'similarity', '1.00')) |
@@ -44,6 +45,12 b' def mvcheck(orig, ui, repo, *pats, **opt' | |||
|
44 | 45 | return orig(ui, repo, *pats, **opts) |
|
45 | 46 | |
|
46 | 47 | def _interestingfiles(repo, matcher): |
|
48 | """Find what files were added or removed in this commit. | |
|
49 | ||
|
50 | Returns a tuple of two lists: (added, removed). Only files not *already* | |
|
51 | marked as moved are included in the added list. | |
|
52 | ||
|
53 | """ | |
|
47 | 54 | stat = repo.status(match=matcher) |
|
48 | 55 | added = stat[1] |
|
49 | 56 | removed = stat[2] |
@@ -55,8 +62,12 b' def _interestingfiles(repo, matcher):' | |||
|
55 | 62 | return added, removed |
|
56 | 63 | |
|
57 | 64 | def _findrenames(repo, matcher, added, removed, similarity): |
|
58 | """Find renames from removed files of the current commit/amend files | |
|
59 | to the added ones""" | |
|
65 | """Find what files in added are really moved files. | |
|
66 | ||
|
67 | Any file named in removed that is at least similarity% similar to a file | |
|
68 | in added is seen as a rename. | |
|
69 | ||
|
70 | """ | |
|
60 | 71 | renames = {} |
|
61 | 72 | if similarity > 0: |
|
62 | 73 | for src, dst, score in similar.findrenames( |
General Comments 0
You need to be logged in to leave comments.
Login now