Mercurial > public > mercurial-scm > hg-stable
diff mercurial/templatekw.py @ 25348:f26efa4f0eff
templatekw: introduce active subkeyword from bookmarks keyword
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.
author | Ryan McElroy <rmcelroy@fb.com> |
---|---|
date | Thu, 28 May 2015 20:03:42 -0700 |
parents | 277aba2c151a |
children | 390a10b7843b |
line wrap: on
line diff
--- a/mercurial/templatekw.py Thu Apr 16 15:18:59 2015 -0700 +++ b/mercurial/templatekw.py Thu May 28 20:03:42 2015 -0700 @@ -206,12 +206,12 @@ def showbookmarks(**args): """:bookmarks: List of strings. Any bookmarks associated with the - changeset. + changeset. Also sets 'active', the name of the active bookmark. """ repo = args['ctx']._repo bookmarks = args['ctx'].bookmarks() - current = repo._activebookmark - makemap = lambda v: {'bookmark': v, 'current': current} + active = repo._activebookmark + makemap = lambda v: {'bookmark': v, 'active': active, 'current': active} f = _showlist('bookmark', bookmarks, **args) return _hybrid(f, bookmarks, makemap, lambda x: x['bookmark'])