Show More
@@ -93,6 +93,9 b' def _findsimilarmatches(repo, added, rem' | |||||
93 | source, bscore = v |
|
93 | source, bscore = v | |
94 | yield source, dest, bscore |
|
94 | yield source, dest, bscore | |
95 |
|
95 | |||
|
96 | def _dropempty(fctxs): | |||
|
97 | return [x for x in fctxs if x.size() > 0] | |||
|
98 | ||||
96 | def findrenames(repo, added, removed, threshold): |
|
99 | def findrenames(repo, added, removed, threshold): | |
97 | '''find renamed files -- yields (before, after, score) tuples''' |
|
100 | '''find renamed files -- yields (before, after, score) tuples''' | |
98 | wctx = repo[None] |
|
101 | wctx = repo[None] | |
@@ -101,10 +104,8 b' def findrenames(repo, added, removed, th' | |||||
101 | # Zero length files will be frequently unrelated to each other, and |
|
104 | # Zero length files will be frequently unrelated to each other, and | |
102 | # tracking the deletion/addition of such a file will probably cause more |
|
105 | # tracking the deletion/addition of such a file will probably cause more | |
103 | # harm than good. We strip them out here to avoid matching them later on. |
|
106 | # harm than good. We strip them out here to avoid matching them later on. | |
104 |
addedfiles = |
|
107 | addedfiles = _dropempty(wctx[fp] for fp in sorted(added)) | |
105 | if wctx[fp].size() > 0] |
|
108 | removedfiles = _dropempty(pctx[fp] for fp in sorted(removed) if fp in pctx) | |
106 | removedfiles = [pctx[fp] for fp in sorted(removed) |
|
|||
107 | if fp in pctx and pctx[fp].size() > 0] |
|
|||
108 |
|
109 | |||
109 | # Find exact matches. |
|
110 | # Find exact matches. | |
110 | matchedfiles = set() |
|
111 | matchedfiles = set() |
General Comments 0
You need to be logged in to leave comments.
Login now