# HG changeset patch # User Idan Kamara # Date 1304091816 -10800 # Node ID 3fc7154396d23426a355e9403890837118d045f6 # Parent 0e6f622f31cad54005fbe08838fc289e65f8310d bookmarks: further restrict IOError on write This won't risk losing the undo file when the error was something other than file not found diff -r 0e6f622f31ca -r 3fc7154396d2 mercurial/bookmarks.py --- 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)