mercurial/subrepo.py
changeset 21889 ee7e8dcffc92
parent 21888 dfb8f757750c
child 21891 db8a27d92818
--- a/mercurial/subrepo.py	Fri Jun 20 00:21:19 2014 +0900
+++ b/mercurial/subrepo.py	Fri Jun 20 00:21:19 2014 +0900
@@ -596,8 +596,10 @@
             if not os.path.exists(cachedir):
                 util.makedirs(cachedir, notindexed=True)
             fd = open(cachefile, 'w')
-            fd.writelines(storehash)
-            fd.close()
+            try:
+                fd.writelines(storehash)
+            finally:
+                fd.close()
         finally:
             lock.release()