Mercurial > hg-stable
diff hgext/bookmarks.py @ 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 | 6e79a3bb8c79 |
children | 7f2b8aac7bdc |
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)