Show More
@@ -290,18 +290,19 b' def findrenames(repo, added, removed, th' | |||||
290 | equal = 0 |
|
290 | equal = 0 | |
291 | alines = mdiff.splitnewlines(text) |
|
291 | alines = mdiff.splitnewlines(text) | |
292 | matches = bdiff.blocks(text, orig) |
|
292 | matches = bdiff.blocks(text, orig) | |
293 | for x1,x2,y1,y2 in matches: |
|
293 | for x1, x2, y1, y2 in matches: | |
294 | for line in alines[x1:x2]: |
|
294 | for line in alines[x1:x2]: | |
295 | equal += len(line) |
|
295 | equal += len(line) | |
296 |
|
296 | |||
297 | lengths = len(text) + len(orig) |
|
297 | lengths = len(text) + len(orig) | |
298 | return equal*2.0 / lengths |
|
298 | return equal * 2.0 / lengths | |
299 |
|
299 | |||
300 | for a in added: |
|
300 | for a in added: | |
301 | bestscore = copies.get(a, (None, threshold))[1] |
|
301 | bestscore = copies.get(a, (None, threshold))[1] | |
302 | myscore = score(repo.wread(a)) |
|
302 | myscore = score(repo.wread(a)) | |
303 | if myscore >= bestscore: |
|
303 | if myscore >= bestscore: | |
304 | copies[a] = (r, myscore) |
|
304 | copies[a] = (r, myscore) | |
|
305 | ||||
305 | for dest, v in copies.iteritems(): |
|
306 | for dest, v in copies.iteritems(): | |
306 | source, score = v |
|
307 | source, score = v | |
307 | yield source, dest, score |
|
308 | yield source, dest, score |
General Comments 0
You need to be logged in to leave comments.
Login now