equal
deleted
inserted
replaced
23 ''' |
23 ''' |
24 numfiles = len(added) + len(removed) |
24 numfiles = len(added) + len(removed) |
25 |
25 |
26 # Get hashes of removed files. |
26 # Get hashes of removed files. |
27 hashes = {} |
27 hashes = {} |
28 for i, fctx in enumerate(removed): |
28 for i, fctx in enumerate(reversed(removed)): |
29 repo.ui.progress(_('searching for exact renames'), i, total=numfiles, |
29 repo.ui.progress(_('searching for exact renames'), i, total=numfiles, |
30 unit=_('files')) |
30 unit=_('files')) |
31 h = hashlib.sha1(fctx.data()).digest() |
31 h = hashlib.sha1(fctx.data()).digest() |
32 hashes[h] = fctx |
32 hashes[h] = fctx |
33 |
33 |
83 for a in added: |
83 for a in added: |
84 bestscore = copies.get(a, (None, threshold))[1] |
84 bestscore = copies.get(a, (None, threshold))[1] |
85 if data is None: |
85 if data is None: |
86 data = _ctxdata(r) |
86 data = _ctxdata(r) |
87 myscore = _score(a, data) |
87 myscore = _score(a, data) |
88 if myscore >= bestscore: |
88 if myscore > bestscore: |
89 copies[a] = (r, myscore) |
89 copies[a] = (r, myscore) |
90 repo.ui.progress(_('searching'), None) |
90 repo.ui.progress(_('searching'), None) |
91 |
91 |
92 for dest, v in copies.iteritems(): |
92 for dest, v in copies.iteritems(): |
93 source, bscore = v |
93 source, bscore = v |