comparison mercurial/similar.py @ 51700:7f0cb9ee0534

Backout accidental publication of a large range of revisions I accidentally published 25e7f9dcad0f::bd1483fd7088, this is the inverse.
author Raphaël Gomès <rgomes@octobus.net>
date Tue, 23 Jul 2024 10:02:46 +0200
parents 493034cc3265
children ca7bde5dbafb
comparison
equal deleted inserted replaced
51699:bd1483fd7088 51700:7f0cb9ee0534
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)