comparison tests/test-addremove-similar.out @ 4135:6cb6cfe43c5d

Avoid some false positives for addremove -s The original code uses the similary score 1 - len(diff(after, before)) / len(after) The diff can at most be the size of the 'before' file, so any small 'before' file would be considered very similar. Removing an empty file would cause all files added in the same revision to be considered copies of the removed file. This changes the metric to bytes_overlap(before, after) / len(before + after) i.e. the actual percentage of bytes shared between the two files.
author Erling Ellingsen <erlingalf@gmail.com>
date Sun, 18 Feb 2007 20:39:25 +0100
parents
children 736e49292809
comparison
equal deleted inserted replaced
4134:9dc64c8414ca 4135:6cb6cfe43c5d
1 adding empty-file
2 adding large-file
3 adding another-file
4 removing empty-file
5 removing large-file
6 recording removal of large-file as rename to another-file (99% similar)
7 adding large-file
8 adding tiny-file
9 adding small-file
10 removing large-file
11 removing tiny-file
12 recording removal of tiny-file as rename to small-file (82% similar)