bookmarks: always write undo file stable
authorDavid Soria Parra <dsp@php.net>
Thu, 27 Jan 2011 02:55:11 +0100
branchstable
changeset 13306 146bad852ede
parent 13305 035684c6b69a
child 13307 7f2b8aac7bdc
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.
hgext/bookmarks.py
--- 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)