mercurial/bookmarks.py
branchstable
changeset 16191 7c75924a6926
parent 15984 894f83a35653
child 16194 6ba530122d8b
--- a/mercurial/bookmarks.py	Tue Feb 28 10:06:35 2012 +0100
+++ b/mercurial/bookmarks.py	Tue Feb 28 23:47:46 2012 +0200
@@ -126,6 +126,17 @@
         wlock.release()
     repo._bookmarkcurrent = mark
 
+def unsetcurrent(repo):
+    wlock = repo.wlock()
+    try:
+        util.unlink(repo.join('bookmarks.current'))
+        repo._bookmarkcurrent = None
+    except OSError, inst:
+        if inst.errno != errno.ENOENT:
+            raise
+    finally:
+        wlock.release()
+
 def updatecurrentbookmark(repo, oldnode, curbranch):
     try:
         return update(repo, oldnode, repo.branchtags()[curbranch])