mercurial/cmdutil.py
changeset 32873 2ecce24dfcd3
parent 32862 e4a43b810528
child 32875 c8f2cf18b82e
equal deleted inserted replaced
32872:9fcb6df413c9 32873:2ecce24dfcd3
  2295     spec = ui.config('ui', 'graphnodetemplate')
  2295     spec = ui.config('ui', 'graphnodetemplate')
  2296     if not spec:
  2296     if not spec:
  2297         return templatekw.showgraphnode  # fast path for "{graphnode}"
  2297         return templatekw.showgraphnode  # fast path for "{graphnode}"
  2298 
  2298 
  2299     spec = templater.unquotestring(spec)
  2299     spec = templater.unquotestring(spec)
  2300     templ = formatter.maketemplater(ui, 'graphnode', spec)
  2300     templ = formatter.maketemplater(ui, spec)
  2301     cache = {}
  2301     cache = {}
  2302     if isinstance(displayer, changeset_templater):
  2302     if isinstance(displayer, changeset_templater):
  2303         cache = displayer.cache  # reuse cache of slow templates
  2303         cache = displayer.cache  # reuse cache of slow templates
  2304     props = templatekw.keywords.copy()
  2304     props = templatekw.keywords.copy()
  2305     props['templ'] = templ
  2305     props['templ'] = templ
  2307     def formatnode(repo, ctx):
  2307     def formatnode(repo, ctx):
  2308         props['ctx'] = ctx
  2308         props['ctx'] = ctx
  2309         props['repo'] = repo
  2309         props['repo'] = repo
  2310         props['ui'] = repo.ui
  2310         props['ui'] = repo.ui
  2311         props['revcache'] = {}
  2311         props['revcache'] = {}
  2312         return templater.stringify(templ('graphnode', **props))
  2312         return templ.render(props)
  2313     return formatnode
  2313     return formatnode
  2314 
  2314 
  2315 def displaygraph(ui, repo, dag, displayer, edgefn, getrenamed=None,
  2315 def displaygraph(ui, repo, dag, displayer, edgefn, getrenamed=None,
  2316                  filematcher=None):
  2316                  filematcher=None):
  2317     formatnode = _graphnodeformatter(ui, displayer)
  2317     formatnode = _graphnodeformatter(ui, displayer)