formatter: look for template symbols from the associated name
Otherwise symbolsused() would fail if a named template is specified with -T.
--- a/mercurial/formatter.py Mon Jun 25 15:54:56 2018 +0530
+++ b/mercurial/formatter.py Mon Jun 18 21:58:04 2018 +0900
@@ -420,7 +420,7 @@
@util.propertycache
def _symbolsused(self):
- return self._t.symbolsuseddefault()
+ return self._t.symbolsused(self._tref)
def contexthint(self, datafields):
'''set of context object keys to be required by the template, given
--- a/tests/test-annotate.t Mon Jun 25 15:54:56 2018 +0530
+++ b/tests/test-annotate.t Mon Jun 18 21:58:04 2018 +0900
@@ -80,6 +80,9 @@
$ hg annotate -T'{lines % "{rev}:{line_number}: {line}"}' a
0:1: a
+ $ hg annotate -Ta a \
+ > --config templates.a='"{lines % "{rev}:{line_number}: {line}"}"'
+ 0:1: a
$ cat <<EOF >>a
> a