diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py --- a/mercurial/logcmdutil.py +++ b/mercurial/logcmdutil.py @@ -837,7 +837,7 @@ def getlinerangerevs(repo, userrevs, opt 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 --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -528,6 +528,9 @@ def showfiles(**args): 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]