changeset 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 6284b0b16033
children 80d8bd69b5db
files mercurial/bookmarks.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
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)