use atomictemp files to write the dirstate
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Mon, 09 Apr 2007 04:24:17 -0300
changeset 4330 1b9fc3f48861
parent 4329 cea5ba038a1d
child 4331 ce52deed83bc
use atomictemp files to write the dirstate
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Mon Apr 09 04:24:17 2007 -0300
+++ b/mercurial/dirstate.py	Mon Apr 09 04:24:17 2007 -0300
@@ -315,7 +315,7 @@
     def write(self):
         if not self.dirty:
             return
-        st = self.opener("dirstate", "w", atomic=True)
+        st = self.opener("dirstate", "w", atomictemp=True)
         st.write("".join(self.pl))
         for f, e in self.map.items():
             c = self.copied(f)
@@ -323,6 +323,7 @@
                 f = f + "\0" + c
             e = struct.pack(self.format, e[0], e[1], e[2], e[3], len(f))
             st.write(e + f)
+        st.rename()
         self.dirty = 0
 
     def filterfiles(self, files):