diff mercurial/dirstate.py @ 18078:3d1dc7aeca39

merge with crew-stable
author Kevin Bullock <kbullock@ringworld.org>
date Sun, 16 Dec 2012 23:02:54 -0600
parents 1a570f04de07 777084ac8416
children 365fecd984c7
line wrap: on
line diff
--- a/mercurial/dirstate.py	Sun Dec 16 22:00:38 2012 -0600
+++ b/mercurial/dirstate.py	Sun Dec 16 23:02:54 2012 -0600
@@ -264,8 +264,10 @@
         f = self._opener('branch', 'w', atomictemp=True)
         try:
             f.write(self._branch + '\n')
-        finally:
             f.close()
+        except: # re-raises
+            f.discard()
+            raise
 
     def _read(self):
         self._map = {}