changeset 36441:27cd83152d31

templatekw: simply override {graphwidth} function by mapping variable
author Yuya Nishihara <yuya@tcha.org>
date Sun, 25 Feb 2018 14:12:34 +0900
parents bb852a525633
children e46b24582fa0
files mercurial/logcmdutil.py mercurial/templatekw.py
diffstat 2 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/logcmdutil.py	Sun Feb 25 16:40:41 2018 +0900
+++ b/mercurial/logcmdutil.py	Sun Feb 25 14:12:34 2018 +0900
@@ -889,7 +889,7 @@
         firstedge = next(edges)
         width = firstedge[2]
         displayer.show(ctx, copies=copies,
-                       _graphwidth=width, **pycompat.strkwargs(props))
+                       graphwidth=width, **pycompat.strkwargs(props))
         lines = displayer.hunk.pop(rev).split('\n')
         if not lines[-1]:
             del lines[-1]
--- a/mercurial/templatekw.py	Sun Feb 25 16:40:41 2018 +0900
+++ b/mercurial/templatekw.py	Sun Feb 25 14:12:34 2018 +0900
@@ -552,9 +552,8 @@
 @templatekeyword('graphwidth')
 def showgraphwidth(repo, ctx, templ, **args):
     """Integer. The width of the graph drawn by 'log --graph' or zero."""
-    # The value args['graphwidth'] will be this function, so we use an internal
-    # name to pass the value through props into this function.
-    return args.get('_graphwidth', 0)
+    # just hosts documentation; should be overridden by template mapping
+    return 0
 
 @templatekeyword('index')
 def showindex(**args):