diff -r a5a95642144b -r 390a10b7843b mercurial/templatekw.py --- a/mercurial/templatekw.py Sun May 24 18:30:27 2015 +0900 +++ b/mercurial/templatekw.py Wed Apr 15 09:07:54 2015 -0700 @@ -230,12 +230,9 @@ def showactivebookmark(**args): """:activetbookmark: String. The active bookmark, if it is associated with the changeset""" - import bookmarks as bookmarks # to avoid circular import issues - repo = args['repo'] - if bookmarks.isactivewdirparent(repo): - active = repo._activebookmark - if active in args['ctx'].bookmarks(): - return active + active = args['repo']._activebookmark + if active and active in args['ctx'].bookmarks(): + return active return '' def showdate(repo, ctx, templ, **args):