Mercurial > hg
changeset 34189:e9898ad31115
cmdutil: allow extra properties to be added to each context
The changeset displayer allows setting extra keywords to be available
to the templating layer. This patch adds an argument to displaygraph()
to pass a dict of extra properties to be available to every changeset.
Differential Revision: https://phab.mercurial-scm.org/D555
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 03 Aug 2017 21:13:27 -0700 |
parents | 1246acdad653 |
children | 4441c1113eb2 |
files | mercurial/cmdutil.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Thu Sep 14 09:41:22 2017 -0700 +++ b/mercurial/cmdutil.py Thu Aug 03 21:13:27 2017 -0700 @@ -2617,7 +2617,8 @@ return formatnode def displaygraph(ui, repo, dag, displayer, edgefn, getrenamed=None, - filematcher=None): + filematcher=None, props=None): + props = props or {} formatnode = _graphnodeformatter(ui, displayer) state = graphmod.asciistate() styles = state['styles'] @@ -2658,7 +2659,7 @@ firstedge = next(edges) width = firstedge[2] displayer.show(ctx, copies=copies, matchfn=revmatchfn, - _graphwidth=width) + _graphwidth=width, **props) lines = displayer.hunk.pop(rev).split('\n') if not lines[-1]: del lines[-1]