Mercurial > hg
comparison mercurial/scmutil.py @ 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 | 7caf632e30c3 |
children | 4ec8bee15930 |
comparison
equal
deleted
inserted
replaced
40634:c9876c00d292 | 40635:acd17caa699a |
---|---|
1164 wctx.add([dst]) | 1164 wctx.add([dst]) |
1165 elif not dryrun: | 1165 elif not dryrun: |
1166 wctx.copy(origsrc, dst) | 1166 wctx.copy(origsrc, dst) |
1167 | 1167 |
1168 def writerequires(opener, requirements): | 1168 def writerequires(opener, requirements): |
1169 with opener('requires', 'w') as fp: | 1169 with opener('requires', 'w', atomictemp=True) as fp: |
1170 for r in sorted(requirements): | 1170 for r in sorted(requirements): |
1171 fp.write("%s\n" % r) | 1171 fp.write("%s\n" % r) |
1172 | 1172 |
1173 class filecachesubentry(object): | 1173 class filecachesubentry(object): |
1174 def __init__(self, path, stat): | 1174 def __init__(self, path, stat): |