D555: cmdutil: allow extra properties to be added to each context
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Tue Aug 29 03:55:26 UTC 2017
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
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.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D555
AFFECTED FILES
mercurial/cmdutil.py
CHANGE DETAILS
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2616,7 +2616,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']
@@ -2657,7 +2658,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]
To: indygreg, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list