##// END OF EJS Templates
similar: compare between actual file contents for exact identity...
similar: compare between actual file contents for exact identity Before this patch, similarity detection logic (for addremove and automv) depends entirely on SHA-1 digesting. But this causes incorrect rename detection, if: - removing file A and adding file B occur at same committing, and - SHA-1 hash values of file A and B are same This may prevent security experts from managing sample files for SHAttered issue in Mercurial repository, for example. https://security.googleblog.com/2017/02/announcing-first-sha1-collision.html https://shattered.it/ Hash collision itself isn't so serious for core repository functionality of Mercurial, described by mpm as below, though. https://www.mercurial-scm.org/wiki/mpm/SHA1 This patch compares between actual file contents after hash comparison for exact identity. Even after this patch, SHA-1 is still used, because it is reasonable enough to quickly detect existence of "(almost) same" file. - replacing SHA-1 causes decreasing performance, and - replacement of it has ambiguity, yet Getting content of removed file (= rfctx.data()) at each exact comparison should be cheap enough, even though getting content of added one costs much. ======= ============== ===================== file fctx data() reads from ======= ============== ===================== removed filectx in-memory revlog data added workingfilectx storage ======= ============== =====================
FUJIWARA Katsunori -
r31210:e1d03590 default
Show More
Name Size Modified Last Commit Author
/ hgext
convert
fsmonitor
highlight
largefiles
zeroconf
__init__.py Loading ...
acl.py Loading ...
automv.py Loading ...
blackbox.py Loading ...
bugzilla.py Loading ...
censor.py Loading ...
children.py Loading ...
churn.py Loading ...
clonebundles.py Loading ...
color.py Loading ...
eol.py Loading ...
extdiff.py Loading ...
factotum.py Loading ...
fetch.py Loading ...
gpg.py Loading ...
graphlog.py Loading ...
hgk.py Loading ...
histedit.py Loading ...
journal.py Loading ...
keyword.py Loading ...
logtoprocess.py Loading ...
mq.py Loading ...
notify.py Loading ...
pager.py Loading ...
patchbomb.py Loading ...
purge.py Loading ...
rebase.py Loading ...
record.py Loading ...
relink.py Loading ...
schemes.py Loading ...
share.py Loading ...
shelve.py Loading ...
strip.py Loading ...
transplant.py Loading ...
win32mbcs.py Loading ...
win32text.py Loading ...