# HG changeset patch # User Siddharth Agarwal # Date 1384569700 28800 # Node ID 0f01d0692bc54551bc62c64f3dfd793708bd901b # Parent 6284b0b160333d737bf65bb4bb387e0b905d4d12 bookmarks: make setcurrent with None an error diff -r 6284b0b16033 -r 0f01d0692bc5 mercurial/bookmarks.py --- 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 ). 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)