diff mercurial/bookmarks.py @ 14039:3fc7154396d2

bookmarks: further restrict IOError on write This won't risk losing the undo file when the error was something other than file not found
author Idan Kamara <idankk86@gmail.com>
date Fri, 29 Apr 2011 18:43:36 +0300
parents 78ab705a8147
children e4bfb9c337f3
line wrap: on
line diff
--- a/mercurial/bookmarks.py	Fri Apr 29 18:44:56 2011 +0300
+++ b/mercurial/bookmarks.py	Fri Apr 29 18:43:36 2011 +0300
@@ -73,7 +73,9 @@
 
     try:
         bms = repo.opener('bookmarks').read()
-    except IOError:
+    except IOError, inst:
+        if inst.errno != errno.ENOENT:
+            raise
         bms = ''
     repo.opener('undo.bookmarks', 'w').write(bms)