116 addedfiles = _dropempty(wctx[fp] for fp in sorted(added)) |
116 addedfiles = _dropempty(wctx[fp] for fp in sorted(added)) |
117 removedfiles = _dropempty(pctx[fp] for fp in sorted(removed) if fp in pctx) |
117 removedfiles = _dropempty(pctx[fp] for fp in sorted(removed) if fp in pctx) |
118 |
118 |
119 # Find exact matches. |
119 # Find exact matches. |
120 matchedfiles = set() |
120 matchedfiles = set() |
121 for a, b in _findexactmatches(repo, addedfiles, removedfiles): |
121 for (a, b) in _findexactmatches(repo, addedfiles, removedfiles): |
122 matchedfiles.add(b) |
122 matchedfiles.add(b) |
123 yield (a.path(), b.path(), 1.0) |
123 yield (a.path(), b.path(), 1.0) |
124 |
124 |
125 # If the user requested similar files to be matched, search for them also. |
125 # If the user requested similar files to be matched, search for them also. |
126 if threshold < 1.0: |
126 if threshold < 1.0: |
127 addedfiles = [x for x in addedfiles if x not in matchedfiles] |
127 addedfiles = [x for x in addedfiles if x not in matchedfiles] |
128 for a, b, score in _findsimilarmatches( |
128 for (a, b, score) in _findsimilarmatches( |
129 repo, addedfiles, removedfiles, threshold |
129 repo, addedfiles, removedfiles, threshold |
130 ): |
130 ): |
131 yield (a.path(), b.path(), score) |
131 yield (a.path(), b.path(), score) |