Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/localrepo.py @ 4329:cea5ba038a1d
use atomictemp files to write branch.cache
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Mon, 09 Apr 2007 04:24:17 -0300 |
parents | fe7f38dda34b |
children | 1cc5fc1d0994 1a63b44f90c9 |
comparison
equal
deleted
inserted
replaced
4328:1083ae4b5f0e | 4329:cea5ba038a1d |
---|---|
419 partial, last, lrev = {}, nullid, nullrev | 419 partial, last, lrev = {}, nullid, nullrev |
420 return partial, last, lrev | 420 return partial, last, lrev |
421 | 421 |
422 def _writebranchcache(self, branches, tip, tiprev): | 422 def _writebranchcache(self, branches, tip, tiprev): |
423 try: | 423 try: |
424 f = self.opener("branch.cache", "w") | 424 f = self.opener("branch.cache", "w", atomictemp=True) |
425 f.write("%s %s\n" % (hex(tip), tiprev)) | 425 f.write("%s %s\n" % (hex(tip), tiprev)) |
426 for label, node in branches.iteritems(): | 426 for label, node in branches.iteritems(): |
427 f.write("%s %s\n" % (hex(node), label)) | 427 f.write("%s %s\n" % (hex(node), label)) |
428 f.rename() | |
428 except IOError: | 429 except IOError: |
429 pass | 430 pass |
430 | 431 |
431 def _updatebranchcache(self, partial, start, end): | 432 def _updatebranchcache(self, partial, start, end): |
432 for r in xrange(start, end): | 433 for r in xrange(start, end): |