Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Mar 2017 13:27:42 +0100] rev 31228
vfs: use 'vfs' module directly in 'mercurial.hg'
Now that the 'vfs' classes moved in their own module, lets use the new module
directly. We update code iteratively to help with possible bisect needs in the
future.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 01 Mar 2017 11:00:12 +0100] rev 31227
vfs: extract 'vfs' class and related code to a new 'vfs' module (API)
The 'scmutil' is growing large (1500+ lines) and 2/5 of it is related to vfs.
We extract the 'vfs' related code in its own module get both module back to a
better scale and clearer contents.
We keep all the references available in 'scmutil' for now as many reference
needs to be updated.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Mar 2017 03:52:36 +0100] rev 31226
vfs: replace 'scmutil.opener' usage with 'scmutil.vfs'
The 'vfs' class is the first class citizen for years. We remove all usages of
the older API. This will let us remove the old API eventually.
Durham Goode <durham@fb.com> [Tue, 07 Mar 2017 12:52:00 -0800] rev 31225
fsmonitor: remove use of repo.opener
This has been deprecated, so we need to switch to the appropriate vfs apis.
Kim Alvefur <zash@zash.se> [Tue, 28 Feb 2017 15:19:08 +0100] rev 31224
help: align description of 'base rev' with reality [issue5488]
The text about revlogs seems to be wrong about -1 being used to indicate
the start of a delta chain. Attempt to correct this.
Kyle Lippincott <spectral@google.com> [Wed, 01 Mar 2017 18:37:34 -0800] rev 31223
help: fix internals.changegroups
Add information about tree manifests, copy edit the text and fix up a few
ambiguities.
The document also contains a few additional fixes from Siddharth Agarwal
<sid0@fb.com>, who used it to build a parser for changegroups in Rust.
Yuya Nishihara <yuya@tcha.org> [Fri, 03 Mar 2017 00:11:51 +0900] rev 31222
share: drop 'relshared' requirement as well
Yuya Nishihara <yuya@tcha.org> [Fri, 03 Mar 2017 00:11:18 +0900] rev 31221
share: fix typo to drop 'shared' requirement on unshare
This must be a typo and it seems correct to drop the requirement since the
repo is no longer a shared repository.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 03 Mar 2017 02:57:06 +0900] rev 31220
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
======= ============== =====================
Jun Wu <quark@fb.com> [Thu, 02 Mar 2017 21:49:30 -0800] rev 31219
localrepo: handle rename with hardlinks properly
In "aftertrans", we rename "journal.*" to "undo.*". We expect "journal.*"
files to disappear after renaming.
However, if "journal.foo" and "undo.foo" refer to a same file (hardlink),
rename may be a no-op, leaving both files on disk, according to Linux
manpage [1]:
If oldpath and newpath are existing hard links referring to the same
file, then rename() does nothing, and returns a suc‐ cess status.
The POSIX specification [2] is not very clear about what to do.
To be safe, remove "undo.*" before the rename so "journal.*" cannot be left
on disk.
[1]: http://man7.org/linux/man-pages/man2/rename.2.html
[2]: http://pubs.opengroup.org/onlinepubs/9699919799/