In some cases Mercurial truncating files when updating causes problems. It can
happens when processes are currently reading the file or with big file or on
NFS mounts.
We add an experimental option to use the atomictemp option of vfs.call in
order to avoid the problem.
The localrepository.wwrite seems to assume the files are created without the
x flag; with atomictempfile, the new file might inherit the x flag from
the destination. We force remove it afterward. This code could be refactored
and the flag processing could be moved inside vfs.
This patch should be tested with
--extra-config-opt experimental.update.atomic-file=True
as we disabled the option by default.