merge with crew-stable
authorKevin Bullock <kbullock@ringworld.org>
Sun, 16 Dec 2012 23:02:54 -0600
changeset 18078 3d1dc7aeca39
parent 18075 2c1fc483efa4 (current diff)
parent 18077 777084ac8416 (diff)
child 18079 b3ba69692f8a
merge with crew-stable
mercurial/dirstate.py
--- 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 = {}