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.
--- 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)