# HG changeset patch # User Kevin Bullock # Date 1309893592 18000 # Node ID 5faf9b0ae984b02877837ff6a2e1685d67bd305c # Parent c4095c3519d61f97f78fd767c1f81c6b4f06df80 bookmarks: check if bookmark is actually current Mercurial doesn't remove the bookmarks.current file when updating away from a bookmark, and repo._bookmarkcurrent() doesn't check whether the bookmark read from bookmarks.current is actually current. This patch prevents hg-prompt from reporting a current bookmark when the bookmark in bookmarks.current isn't actually the working directory's first parent. This matches the behavior of the `hg bookmarks` command. diff -r c4095c3519d6 -r 5faf9b0ae984 prompt.py --- a/prompt.py Wed Mar 23 15:42:04 2011 -0400 +++ b/prompt.py Tue Jul 05 14:19:52 2011 -0500 @@ -103,7 +103,12 @@ book = getattr(repo, '_bookmarkcurrent', None) except KeyError: book = getattr(repo, '_bookmarkcurrent', None) - return _with_groups(m.groups(), book) if book else '' + if book: + cur = repo['.'].node() + if repo._bookmarks[book] == cur: + return _with_groups(m.groups(), book) + else: + return '' def _branch(m): g = m.groups()