mercurial/formatter.py
changeset 39624 713085b45810
parent 39623 34ecc0a09c76
child 40140 46f9b1d2daf0
--- a/mercurial/formatter.py	Thu Jun 07 21:48:11 2018 +0900
+++ b/mercurial/formatter.py	Sat Sep 01 15:52:18 2018 +0900
@@ -124,7 +124,6 @@
     error,
     pycompat,
     templatefilters,
-    templatefuncs,
     templatekw,
     templater,
     templateutil,
@@ -193,9 +192,6 @@
         # name is mandatory argument for now, but it could be optional if
         # we have default template keyword, e.g. {item}
         return self._converter.formatlist(data, name, fmt, sep)
-    def contexthint(self, datafields):
-        '''set of context object keys to be required given datafields set'''
-        return set()
     def context(self, **ctxs):
         '''insert context objects to be used to render template keywords'''
         ctxs = pycompat.byteskwargs(ctxs)
@@ -427,24 +423,6 @@
     def _symbolsused(self):
         return self._t.symbolsused(self._tref)
 
-    def contexthint(self, datafields):
-        '''set of context object keys to be required by the template, given
-        datafields overridden by immediate values'''
-        requires = set()
-        ksyms, fsyms = self._symbolsused
-        ksyms = ksyms - set(datafields.split())  # exclude immediate fields
-        symtables = [(ksyms, templatekw.keywords),
-                     (fsyms, templatefuncs.funcs)]
-        for syms, table in symtables:
-            for k in syms:
-                f = table.get(k)
-                if not f:
-                    continue
-                requires.update(getattr(f, '_requires', ()))
-        if 'repo' in requires:
-            requires.add('ctx')  # there's no API to pass repo to formatter
-        return requires & {'ctx', 'fctx'}
-
     def datahint(self):
         '''set of field names to be referenced from the template'''
         return self._symbolsused[0]