Commit Graph

5 Commits

Author SHA1 Message Date
Benoit Boissinot
bee6cb3d55 addremove/findrenames: find renames according to the match object (issue1527)
Instead of only finding similarities in the added/removed files found
by the addremove step, follow the match object:

hg addremove -s80 foo -> add and removes files in foo
                         + find similarities between files in foo
hg addremove -s80 -> add and removes files in the whole repo
                     + find similarities between files in the whole repo

hg import --similarity will still work correctly (only find similarities
between files found in the patch).
2009-05-17 22:51:17 +02:00
Matt Mackall
8cb2b4a288 dirstate.walk: push sorting up 2008-07-22 13:03:19 -05:00
Bryan O'Sullivan
a09e8936ae addremove: print meaningful error message if --similar not numeric 2007-07-21 19:07:18 -07:00
Thomas Arendsen Hein
128193f3e9 addremove: comparing two empty files caused ZeroDivisionError
(found by Giorgos Keramidas)
2007-06-01 16:00:40 +02:00
Erling Ellingsen
77c63b0f24 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.
2007-02-18 20:39:25 +01:00