mercurial/localrepo.py
changeset 4329 cea5ba038a1d
parent 4266 fe7f38dda34b
child 4335 f4a1eac52d43
child 4415 1a63b44f90c9
--- 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