Mercurial > public > mercurial-scm > hg
diff mercurial/bookmarks.py @ 16191:7c75924a6926 stable
update: delete bookmarks.current when explicitly updating to a rev (issue3276)
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Tue, 28 Feb 2012 23:47:46 +0200 |
parents | 894f83a35653 |
children | 6ba530122d8b |
line wrap: on
line diff
--- 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])