# HG changeset patch # User Yuya Nishihara # Date 1519536512 -32400 # Node ID 6ad140dc4269d119c755d1da4dd573b83895e841 # Parent d697e39f61a6c2321b7ccae3d093f57ad382d52d templatekw: extract non-templatekw function as getgraphnode() Prepares for switching to the (context, mapping) API. We still need (repo, ctx) function for the fast path. diff -r d697e39f61a6 -r 6ad140dc4269 mercurial/logcmdutil.py --- a/mercurial/logcmdutil.py Wed Feb 28 16:24:39 2018 +0100 +++ b/mercurial/logcmdutil.py Sun Feb 25 14:28:32 2018 +0900 @@ -837,7 +837,7 @@ def _graphnodeformatter(ui, displayer): spec = ui.config('ui', 'graphnodetemplate') if not spec: - return templatekw.showgraphnode # fast path for "{graphnode}" + return templatekw.getgraphnode # fast path for "{graphnode}" spec = templater.unquotestring(spec) tres = formatter.templateresources(ui) diff -r d697e39f61a6 -r 6ad140dc4269 mercurial/templatekw.py --- a/mercurial/templatekw.py Wed Feb 28 16:24:39 2018 +0100 +++ b/mercurial/templatekw.py Sun Feb 25 14:28:32 2018 +0900 @@ -528,6 +528,9 @@ def showgraphnode(repo, ctx, **args): """String. The character representing the changeset node in an ASCII revision graph.""" + return getgraphnode(repo, ctx) + +def getgraphnode(repo, ctx): wpnodes = repo.dirstate.parents() if wpnodes[1] == nullid: wpnodes = wpnodes[:1]