Mercurial > hg
comparison mercurial/templatekw.py @ 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 | d65642840c6f |
children | e46b24582fa0 |
comparison
equal
deleted
inserted
replaced
36440:bb852a525633 | 36441:27cd83152d31 |
---|---|
550 return 'o' | 550 return 'o' |
551 | 551 |
552 @templatekeyword('graphwidth') | 552 @templatekeyword('graphwidth') |
553 def showgraphwidth(repo, ctx, templ, **args): | 553 def showgraphwidth(repo, ctx, templ, **args): |
554 """Integer. The width of the graph drawn by 'log --graph' or zero.""" | 554 """Integer. The width of the graph drawn by 'log --graph' or zero.""" |
555 # The value args['graphwidth'] will be this function, so we use an internal | 555 # just hosts documentation; should be overridden by template mapping |
556 # name to pass the value through props into this function. | 556 return 0 |
557 return args.get('_graphwidth', 0) | |
558 | 557 |
559 @templatekeyword('index') | 558 @templatekeyword('index') |
560 def showindex(**args): | 559 def showindex(**args): |
561 """Integer. The current iteration of the loop. (0 indexed)""" | 560 """Integer. The current iteration of the loop. (0 indexed)""" |
562 # just hosts documentation; should be overridden by template mapping | 561 # just hosts documentation; should be overridden by template mapping |