mercurial/logcmdutil.py
changeset 36982 255f635c3204
parent 36920 6ff6e1d6b5b8
child 36988 317382151ac3
equal deleted inserted replaced
36978:c479692690ef 36982:255f635c3204
   421         self.t = formatter.loadtemplater(ui, tmplspec,
   421         self.t = formatter.loadtemplater(ui, tmplspec,
   422                                          defaults=templatekw.keywords,
   422                                          defaults=templatekw.keywords,
   423                                          resources=tres,
   423                                          resources=tres,
   424                                          cache=templatekw.defaulttempl)
   424                                          cache=templatekw.defaulttempl)
   425         self._counter = itertools.count()
   425         self._counter = itertools.count()
   426         self.cache = tres['cache']  # shared with _graphnodeformatter()
   426         self._getcache = tres['cache']  # shared with _graphnodeformatter()
   427 
   427 
   428         self._tref = tmplspec.ref
   428         self._tref = tmplspec.ref
   429         self._parts = {'header': '', 'footer': '',
   429         self._parts = {'header': '', 'footer': '',
   430                        tmplspec.ref: tmplspec.ref,
   430                        tmplspec.ref: tmplspec.ref,
   431                        'docheader': '', 'docfooter': '',
   431                        'docheader': '', 'docfooter': '',
   850         return templatekw.getgraphnode  # fast path for "{graphnode}"
   850         return templatekw.getgraphnode  # fast path for "{graphnode}"
   851 
   851 
   852     spec = templater.unquotestring(spec)
   852     spec = templater.unquotestring(spec)
   853     tres = formatter.templateresources(ui)
   853     tres = formatter.templateresources(ui)
   854     if isinstance(displayer, changesettemplater):
   854     if isinstance(displayer, changesettemplater):
   855         tres['cache'] = displayer.cache  # reuse cache of slow templates
   855         # reuse cache of slow templates
       
   856         tres['cache'] = displayer._getcache
   856     templ = formatter.maketemplater(ui, spec, defaults=templatekw.keywords,
   857     templ = formatter.maketemplater(ui, spec, defaults=templatekw.keywords,
   857                                     resources=tres)
   858                                     resources=tres)
   858     def formatnode(repo, ctx):
   859     def formatnode(repo, ctx):
   859         props = {'ctx': ctx, 'repo': repo, 'revcache': {}}
   860         props = {'ctx': ctx, 'repo': repo, 'revcache': {}}
   860         return templ.render(props)
   861         return templ.render(props)