##// END OF EJS Templates
similar: take the first match instead of the last...
Yuya Nishihara -
r31583:2efd9771 default
parent child Browse files
Show More
@@ -25,7 +25,7 b' def _findexactmatches(repo, added, remov'
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()
@@ -85,7 +85,7 b' def _findsimilarmatches(repo, added, rem'
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
@@ -101,7 +101,7 b' pick one from many identical files'
101 removing 8
101 removing 8
102 removing 9
102 removing 9
103 adding a
103 adding a
104 recording removal of 9 as rename to a (100% similar)
104 recording removal of 0 as rename to a (100% similar)
105 $ hg revert -aq
105 $ hg revert -aq
106
106
107 pick one from many similar files
107 pick one from many similar files
@@ -124,7 +124,7 b' pick one from many similar files'
124 removing 8
124 removing 8
125 removing 9
125 removing 9
126 adding a
126 adding a
127 recording removal of 9 as rename to a (99% similar)
127 recording removal of 0 as rename to a (99% similar)
128 $ hg commit -m 'always the same file should be selected'
128 $ hg commit -m 'always the same file should be selected'
129
129
130 should all fail
130 should all fail
General Comments 0
You need to be logged in to leave comments. Login now