mercurial/localrepo.py
changeset 4335 f4a1eac52d43
parent 4276 cb6107f78b92
parent 4329 cea5ba038a1d
child 4372 4ddc6d374265
--- a/mercurial/localrepo.py	Sat Apr 07 04:45:27 2007 -0300
+++ b/mercurial/localrepo.py	Tue Apr 10 14:05:15 2007 -0500
@@ -417,10 +417,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