changeset 13306:146bad852ede stable

bookmarks: always write undo file Always write the undo file. Otherwise, rollback will not work for the initial bookmark as undo.bookmarks doesn't exists. In this case undo.bookmarks needs already be empty.
author David Soria Parra <dsp@php.net>
date Thu, 27 Jan 2011 02:55:11 +0100
parents 035684c6b69a
children 7f2b8aac7bdc
files hgext/bookmarks.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/bookmarks.py	Wed Jan 26 19:14:30 2011 +0100
+++ b/hgext/bookmarks.py	Thu Jan 27 02:55:11 2011 +0100
@@ -48,9 +48,8 @@
     try:
         bms = repo.opener('bookmarks').read()
     except IOError:
-        bms = None
-    if bms is not None:
-        repo.opener('undo.bookmarks', 'w').write(bms)
+        bms = ''
+    repo.opener('undo.bookmarks', 'w').write(bms)
 
     if repo._bookmarkcurrent not in refs:
         setcurrent(repo, None)