mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 00:14:35 +03:00
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.
This commit is contained in:
parent
6acaea3ec5
commit
7cd7aaf7a6
@ -90,9 +90,9 @@ Some sample command line templates:
|
||||
|
||||
$ hg log -r 0 --template "{join(extras, '\n')}\n"
|
||||
|
||||
- Mark the current bookmark with '*'::
|
||||
- Mark the active bookmark with '*'::
|
||||
|
||||
$ hg log --template "{bookmarks % '{bookmark}{ifeq(bookmark, current, \"*\")} '}\n"
|
||||
$ hg log --template "{bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
|
||||
|
||||
- Mark the working copy parent with '@'::
|
||||
|
||||
|
@ -206,12 +206,12 @@ def showbranches(**args):
|
||||
|
||||
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'])
|
||||
|
||||
|
@ -3086,7 +3086,7 @@ Test current bookmark templating
|
||||
|
||||
$ hg book foo
|
||||
$ hg book bar
|
||||
$ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, current, \"*\")} '}\n"
|
||||
$ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n"
|
||||
2 bar* foo
|
||||
1
|
||||
0
|
||||
|
Loading…
Reference in New Issue
Block a user