# HG changeset patch # User Alexis S. L. Carvalho # Date 1176103457 10800 # Node ID cea5ba038a1d7c24cae6f5e84e0d1a94acf71b2e # Parent 1083ae4b5f0eae44e9b11204b7e613fa9d32bc70 use atomictemp files to write branch.cache diff -r 1083ae4b5f0e -r cea5ba038a1d mercurial/localrepo.py --- a/mercurial/localrepo.py Mon Apr 09 04:24:17 2007 -0300 +++ b/mercurial/localrepo.py Mon Apr 09 04:24:17 2007 -0300 @@ -421,10 +421,11 @@ def _writebranchcache(self, branches, tip, tiprev): try: - f = self.opener("branch.cache", "w") + f = self.opener("branch.cache", "w", atomictemp=True) f.write("%s %s\n" % (hex(tip), tiprev)) for label, node in branches.iteritems(): f.write("%s %s\n" % (hex(node), label)) + f.rename() except IOError: pass