##// END OF EJS Templates
templatekw: extract non-templatekw function as getgraphnode()...
Yuya Nishihara -
r36530:6ad140dc default
parent child Browse files
Show More
@@ -837,7 +837,7 b' def getlinerangerevs(repo, userrevs, opt'
837 def _graphnodeformatter(ui, displayer):
837 def _graphnodeformatter(ui, displayer):
838 spec = ui.config('ui', 'graphnodetemplate')
838 spec = ui.config('ui', 'graphnodetemplate')
839 if not spec:
839 if not spec:
840 return templatekw.showgraphnode # fast path for "{graphnode}"
840 return templatekw.getgraphnode # fast path for "{graphnode}"
841
841
842 spec = templater.unquotestring(spec)
842 spec = templater.unquotestring(spec)
843 tres = formatter.templateresources(ui)
843 tres = formatter.templateresources(ui)
@@ -528,6 +528,9 b' def showfiles(**args):'
528 def showgraphnode(repo, ctx, **args):
528 def showgraphnode(repo, ctx, **args):
529 """String. The character representing the changeset node in an ASCII
529 """String. The character representing the changeset node in an ASCII
530 revision graph."""
530 revision graph."""
531 return getgraphnode(repo, ctx)
532
533 def getgraphnode(repo, ctx):
531 wpnodes = repo.dirstate.parents()
534 wpnodes = repo.dirstate.parents()
532 if wpnodes[1] == nullid:
535 if wpnodes[1] == nullid:
533 wpnodes = wpnodes[:1]
536 wpnodes = wpnodes[:1]
General Comments 0
You need to be logged in to leave comments. Login now