##// END OF EJS Templates
findrenames: Optimise "addremove -s100" by matching files by their SHA1 hashes....
findrenames: Optimise "addremove -s100" by matching files by their SHA1 hashes. We speed up 'findrenames' for the usecase when a user specifies they want a similarity of 100% by matching files by their exact SHA1 hash value. This reduces the number of comparisons required to find exact matches from O(n^2) to O(n). While it would be nice if we could just use mercurial's pre-calculated SHA1 hash for existing files, this hash includes the file's ancestor information making it unsuitable for our purposes. Instead, we calculate the hash of old content from scratch. The following benchmarks were taken on the current head of crew: addremove 100% similarity: rm -rf *; hg up -C; mv tests tests.new hg --time addremove -s100 --dry-run before: real 176.350 secs (user 128.890+0.000 sys 47.430+0.000) after: real 2.130 secs (user 1.890+0.000 sys 0.240+0.000) addremove 75% similarity: rm -rf *; hg up -C; mv tests tests.new; \ for i in tests.new/*; do echo x >> $i; done hg --time addremove -s75 --dry-run before: real 264.560 secs (user 215.130+0.000 sys 49.410+0.000) after: real 218.710 secs (user 172.790+0.000 sys 45.870+0.000)
David Greenaway -
r11060:e6df0177 default
Show More
Name Size Modified Last Commit Author
/ mercurial
help
hgweb
pure
templates
__init__.py Loading ...
ancestor.py Loading ...
archival.py Loading ...
base85.c Loading ...
bdiff.c Loading ...
bundlerepo.py Loading ...
byterange.py Loading ...
changegroup.py Loading ...
changelog.py Loading ...
cmdutil.py Loading ...
commands.py Loading ...
config.py Loading ...
context.py Loading ...
copies.py Loading ...
demandimport.py Loading ...
diffhelpers.c Loading ...
dirstate.py Loading ...
dispatch.py Loading ...
encoding.py Loading ...
error.py Loading ...
extensions.py Loading ...
fancyopts.py Loading ...
filelog.py Loading ...
filemerge.py Loading ...
graphmod.py Loading ...
hbisect.py Loading ...
help.py Loading ...
hg.py Loading ...
hook.py Loading ...
httprepo.py Loading ...
i18n.py Loading ...
ignore.py Loading ...
keepalive.py Loading ...
localrepo.py Loading ...
lock.py Loading ...
lsprof.py Loading ...
lsprofcalltree.py Loading ...
mail.py Loading ...
manifest.py Loading ...
match.py Loading ...
mdiff.py Loading ...
merge.py Loading ...
minirst.py Loading ...
mpatch.c Loading ...
node.py Loading ...
osutil.c Loading ...
parsers.c Loading ...
patch.py Loading ...
posix.py Loading ...
repair.py Loading ...
repo.py Loading ...
revlog.py Loading ...
similar.py Loading ...
simplemerge.py Loading ...
sshrepo.py Loading ...
sshserver.py Loading ...
statichttprepo.py Loading ...
store.py Loading ...
streamclone.py Loading ...
strutil.py Loading ...
subrepo.py Loading ...
tags.py Loading ...
templatefilters.py Loading ...
templatekw.py Loading ...
templater.py Loading ...
transaction.py Loading ...
ui.py Loading ...
url.py Loading ...
util.py Loading ...
verify.py Loading ...
win32.py Loading ...
windows.py Loading ...