[PATCH 1 of 3] templatekw: rename variable current to active

Ryan McElroy rmcelroy at fb.com
Fri May 8 19:56:15 CDT 2015


# HG changeset patch
# User Ryan McElroy <rmcelroy at fb.com>
# Date 1429111561 25200
#      Wed Apr 15 08:26:01 2015 -0700
# Node ID 2462f6c6190123d76d653cc3bbc460cd319fe6d6
# Parent  9d8b54137b0b75e605b10c5f71237b2b3f87c209
templatekw: rename variable current to active

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/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -227,9 +227,9 @@ def showcurrentbookmark(**args):
     import bookmarks as bookmarks # to avoid circular import issues
     repo = args['repo']
     if bookmarks.isactivewdirparent(repo):
-        current = repo._activebookmark
-        if current in args['ctx'].bookmarks():
-            return current
+        active = repo._activebookmark
+        if active in args['ctx'].bookmarks():
+            return active
     return ''
 
 def showdate(repo, ctx, templ, **args):


More information about the Mercurial-devel mailing list