Mercurial > public > mercurial-scm > hg
comparison mercurial/dirstate.py @ 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 | 30e7aa755efd |
children | 78b6add1f966 |
comparison
equal
deleted
inserted
replaced
4506:9f952dd4413b | 4507:289ec1f36b11 |
---|---|
356 if c: | 356 if c: |
357 f = f + "\0" + c | 357 f = f + "\0" + c |
358 e = struct.pack(self.format, e[0], e[1], e[2], e[3], len(f)) | 358 e = struct.pack(self.format, e[0], e[1], e[2], e[3], len(f)) |
359 cs.write(e) | 359 cs.write(e) |
360 cs.write(f) | 360 cs.write(f) |
361 st = self.opener("dirstate", "w", atomic=True) | 361 st = self.opener("dirstate", "w", atomictemp=True) |
362 st.write(cs.getvalue()) | 362 st.write(cs.getvalue()) |
363 st.rename() | |
363 self.dirty = 0 | 364 self.dirty = 0 |
364 | 365 |
365 def filterfiles(self, files): | 366 def filterfiles(self, files): |
366 ret = {} | 367 ret = {} |
367 unknown = [] | 368 unknown = [] |