Skip to content
Snippets Groups Projects
Commit 45b678bf authored by Boris Feld's avatar Boris Feld
Browse files

atomicupdate: add an experimental option to use atomictemp when updating

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.

Differential Revision: https://phab.mercurial-scm.org/D1882
parent 2a7e777c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment