[PATCH 4 of 4] templatekw: display non-current bookmarks (issue4552) (BC)

Ryan McElroy rmcelroy at fb.com
Fri May 29 12:22:53 CDT 2015

# HG changeset patch
# User Ryan McElroy <rmcelroy at fb.com>
# Date 1429114074 25200
#      Wed Apr 15 09:07:54 2015 -0700
# Node ID 95b095fb5d865ff5d357bd82905c21145fd4af65
# Parent  4dc7e32d957bcddb9dfe86c6d9443ba1c09fe1ac
templatekw: display non-current bookmarks (issue4552) (BC)

Today, the terms 'active' and 'current' are interchangeably used throughout the
codebase in reference to the active bookmark (the bookmark that will be updated
with the next commit). This leads to confusion among developers and users.
This patch is part of a series to standardize the usage to 'active' throughout
the mercurial codebase and user interface.

diff --git a/README b/README
--- a/README
+++ b/README
@@ -18,3 +18,4 @@ Running without installing:
 See http://mercurial.selenic.com/ for detailed installation
 instructions, platform-specific notes, and Mercurial user information.
diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -230,12 +230,9 @@ def showcurrentbookmark(**args):
 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):

More information about the Mercurial-devel mailing list