Mercurial > hg
diff mercurial/bookmarks.py @ 20100:0f01d0692bc5
bookmarks: make setcurrent with None an error
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Fri, 15 Nov 2013 18:41:40 -0800 |
parents | 2880b45636ca |
children | 67ee87a371b2 |
line wrap: on
line diff
--- a/mercurial/bookmarks.py Fri Nov 15 18:31:02 2013 -0800 +++ b/mercurial/bookmarks.py Fri Nov 15 18:41:40 2013 -0800 @@ -106,13 +106,13 @@ Set the name of the bookmark that we are on (hg update <bookmark>). The name is recorded in .hg/bookmarks.current ''' + if mark not in repo._bookmarks: + raise AssertionError('bookmark %s does not exist!' % mark) + current = repo._bookmarkcurrent if current == mark: return - if mark not in repo._bookmarks: - mark = '' - wlock = repo.wlock() try: file = repo.opener('bookmarks.current', 'w', atomictemp=True)