Mercurial > hg > mercurial-crew-with-dirclash
view tests/test-commit.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 | d7b9ec589546 |
children | fe0fe0b4d73b |
line wrap: on
line source
% commit date test abort: impossible time zone offset: 4444444 transaction abort! rollback completed abort: invalid date: '1\t15.1' transaction abort! rollback completed abort: invalid date: 'foo bar' transaction abort! rollback completed nothing changed % partial commit test trouble committing bar! abort: No such file or directory: .../test/bar adding dir/file dir/file adding dir.file abort: no match under directory .../test/dir! abort: no match under directory .../test/bleh! abort: no match under directory .../test/dir2! dir/file does-not-exist: No such file or directory abort: file .../test/does-not-exist not found! abort: file .../test/baz not tracked! abort: file .../test/quux not tracked! dir/file % partial subdir commit test adding bar/bar adding foo/foo % subdir log 1 changeset: 0:6ef3cb06bb80 user: test date: Mon Jan 12 13:46:40 1970 +0000 files: foo/foo description: commit-subdir-1 % subdir log 2 changeset: 1:f2e51572cf5a tag: tip user: test date: Mon Jan 12 13:46:41 1970 +0000 files: bar/bar description: commit-subdir-2 % full log changeset: 1:f2e51572cf5a tag: tip user: test date: Mon Jan 12 13:46:41 1970 +0000 files: bar/bar description: commit-subdir-2 changeset: 0:6ef3cb06bb80 user: test date: Mon Jan 12 13:46:40 1970 +0000 files: foo/foo description: commit-subdir-1