mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 17:27:53 +03:00
preferredremotebranches: add a template keyword
This commit is contained in:
parent
952dad0680
commit
013442e572
@ -368,4 +368,19 @@ def remotebrancheskw(**args):
|
||||
return templatekw.showlist('remotebranch', names,
|
||||
plural='remotebranches', **args)
|
||||
|
||||
def preferredremotebrancheskw(**args):
|
||||
""":preferredremotebranches: List of strings. List of remote bookmarks and
|
||||
branches associated with the changeset where bookmarks are preferred over
|
||||
displaying branches.
|
||||
"""
|
||||
repo, ctx = args['repo'], args['ctx']
|
||||
remotenames = sorted([name for name, node in
|
||||
repo._preferredremotebranches.iteritems()
|
||||
if node == ctx.node()])
|
||||
if remotenames:
|
||||
return templatekw.showlist('remotebranch', remotenames,
|
||||
plural='remotebranches', **args)
|
||||
|
||||
|
||||
templatekw.keywords['remotebranches'] = remotebrancheskw
|
||||
templatekw.keywords['preferredremotebranches'] = preferredremotebrancheskw
|
||||
|
Loading…
Reference in New Issue
Block a user