# HG changeset patch # User Gregory Szorc # Date 1501820007 25200 # Node ID e9898ad311157617396ea387f1e73c80eff4961b # Parent 1246acdad653401776e4f577c361992f5d8db1c0 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 diff -r 1246acdad653 -r e9898ad31115 mercurial/cmdutil.py --- 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]