This is an archive of the discontinued Mercurial Phabricator instance.

atomicupdate: add an experimental option to use atomictemp when updating
ClosedPublic

Authored by lothiraldan on Jan 18 2018, 7:38 AM.

Details

Summary

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.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

lothiraldan created this revision.Jan 18 2018, 7:38 AM
durin42 accepted this revision.Jan 18 2018, 3:12 PM
This revision is now accepted and ready to land.Jan 18 2018, 3:12 PM
This revision was automatically updated to reflect the committed changes.