changeset 40635:acd17caa699a

requires: use atomictemp=True when writing .hg/requires We use an unusual file system at Google that allows writes (and renames) but not deletions (for certain paths). That causes problems when writing the requires files without atomictemp=True. There doesn't appear to be any real drawbacks to using atomictemp, so I'm hoping we can just change it in core. Differential Revision: https://phab.mercurial-scm.org/D5274
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 14 Nov 2018 11:30:46 -0800
parents c9876c00d292
children 8c6329fa6038
files mercurial/scmutil.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Sun Nov 11 16:47:28 2018 +0900
+++ b/mercurial/scmutil.py	Wed Nov 14 11:30:46 2018 -0800
@@ -1166,7 +1166,7 @@
             wctx.copy(origsrc, dst)
 
 def writerequires(opener, requirements):
-    with opener('requires', 'w') as fp:
+    with opener('requires', 'w', atomictemp=True) as fp:
         for r in sorted(requirements):
             fp.write("%s\n" % r)