##// END OF EJS Templates
bookmarks: make setcurrent with None an error
Siddharth Agarwal -
r20100:0f01d069 default
parent child Browse files
Show More
@@ -106,13 +106,13 b' def setcurrent(repo, mark):'
106 Set the name of the bookmark that we are on (hg update <bookmark>).
106 Set the name of the bookmark that we are on (hg update <bookmark>).
107 The name is recorded in .hg/bookmarks.current
107 The name is recorded in .hg/bookmarks.current
108 '''
108 '''
109 if mark not in repo._bookmarks:
110 raise AssertionError('bookmark %s does not exist!' % mark)
111
109 current = repo._bookmarkcurrent
112 current = repo._bookmarkcurrent
110 if current == mark:
113 if current == mark:
111 return
114 return
112
115
113 if mark not in repo._bookmarks:
114 mark = ''
115
116 wlock = repo.wlock()
116 wlock = repo.wlock()
117 try:
117 try:
118 file = repo.opener('bookmarks.current', 'w', atomictemp=True)
118 file = repo.opener('bookmarks.current', 'w', atomictemp=True)
General Comments 0
You need to be logged in to leave comments. Login now