# HG changeset patch # User Alexis S. L. Carvalho # Date 1181084127 10800 # Node ID 289ec1f36b111574f7a179de9ec916c1d7a7ac02 # Parent 9f952dd4413b6a1993e78fe034658f999263e295 Use atomictemp files to write the dirstate. atomic files are not safe in all cases. diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -358,8 +358,9 @@ class dirstate(object): e = struct.pack(self.format, e[0], e[1], e[2], e[3], len(f)) cs.write(e) cs.write(f) - st = self.opener("dirstate", "w", atomic=True) + st = self.opener("dirstate", "w", atomictemp=True) st.write(cs.getvalue()) + st.rename() self.dirty = 0 def filterfiles(self, files):