diff mercurial/dirstate.py @ 4330:1b9fc3f48861

use atomictemp files to write the dirstate
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Mon, 09 Apr 2007 04:24:17 -0300
parents c93562fb12cc
children f4a1eac52d43 2d32e3ae01a7
line wrap: on
line diff
--- 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):