Mercurial > hg
changeset 4507:289ec1f36b11
Use atomictemp files to write the dirstate.
atomic files are not safe in all cases.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Tue, 05 Jun 2007 19:55:27 -0300 |
parents | 9f952dd4413b |
children | 0026ccc2bf23 |
files | mercurial/dirstate.py |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/dirstate.py Tue Jun 05 19:26:36 2007 -0300 +++ b/mercurial/dirstate.py Tue Jun 05 19:55:27 2007 -0300 @@ -358,8 +358,9 @@ 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):