changeset 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 0e6f622f31ca
children 9d2be7e17fc1
files mercurial/bookmarks.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
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)