mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
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.
This commit is contained in:
parent
f645c6e6fb
commit
e5aec633d1
@ -48,9 +48,8 @@ def write(repo):
|
|||||||
try:
|
try:
|
||||||
bms = repo.opener('bookmarks').read()
|
bms = repo.opener('bookmarks').read()
|
||||||
except IOError:
|
except IOError:
|
||||||
bms = None
|
bms = ''
|
||||||
if bms is not None:
|
repo.opener('undo.bookmarks', 'w').write(bms)
|
||||||
repo.opener('undo.bookmarks', 'w').write(bms)
|
|
||||||
|
|
||||||
if repo._bookmarkcurrent not in refs:
|
if repo._bookmarkcurrent not in refs:
|
||||||
setcurrent(repo, None)
|
setcurrent(repo, None)
|
||||||
|
Loading…
Reference in New Issue
Block a user