Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 32965:3f07f12c6e10
changeset_templater: do not enable verbosity postfix for [templates] section
Since this postfix hack exists only for backward compatibility, we don't need
it for new [templates] section. This isn't a BC as templates defined in
[templates] section weren't loaded until recently.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 22 Apr 2017 21:09:07 +0900 |
parents | 74fa8753990b |
children | 050efe9a1644 |
comparison
equal
deleted
inserted
replaced
32964:74fa8753990b | 32965:3f07f12c6e10 |
---|---|
1582 self.t = formatter.loadtemplater(ui, tmplspec, | 1582 self.t = formatter.loadtemplater(ui, tmplspec, |
1583 cache=templatekw.defaulttempl) | 1583 cache=templatekw.defaulttempl) |
1584 self._counter = itertools.count() | 1584 self._counter = itertools.count() |
1585 self.cache = {} | 1585 self.cache = {} |
1586 | 1586 |
1587 # find correct templates for current mode | |
1588 tmplmodes = [ | |
1589 (True, ''), | |
1590 (self.ui.verbose, '_verbose'), | |
1591 (self.ui.quiet, '_quiet'), | |
1592 (self.ui.debugflag, '_debug'), | |
1593 ] | |
1594 | |
1595 self._tref = tmplspec.ref | 1587 self._tref = tmplspec.ref |
1596 self._parts = {'header': '', 'footer': '', | 1588 self._parts = {'header': '', 'footer': '', |
1597 tmplspec.ref: tmplspec.ref, | 1589 tmplspec.ref: tmplspec.ref, |
1598 'docheader': '', 'docfooter': ''} | 1590 'docheader': '', 'docfooter': ''} |
1599 for mode, postfix in tmplmodes: | 1591 if tmplspec.mapfile: |
1600 for t in self._parts: | 1592 # find correct templates for current mode, for backward |
1601 cur = t + postfix | 1593 # compatibility with 'log -v/-q/--debug' using a mapfile |
1602 if mode and cur in self.t: | 1594 tmplmodes = [ |
1603 self._parts[t] = cur | 1595 (True, ''), |
1596 (self.ui.verbose, '_verbose'), | |
1597 (self.ui.quiet, '_quiet'), | |
1598 (self.ui.debugflag, '_debug'), | |
1599 ] | |
1600 for mode, postfix in tmplmodes: | |
1601 for t in self._parts: | |
1602 cur = t + postfix | |
1603 if mode and cur in self.t: | |
1604 self._parts[t] = cur | |
1604 | 1605 |
1605 if self._parts['docheader']: | 1606 if self._parts['docheader']: |
1606 self.ui.write(templater.stringify(self.t(self._parts['docheader']))) | 1607 self.ui.write(templater.stringify(self.t(self._parts['docheader']))) |
1607 | 1608 |
1608 def close(self): | 1609 def close(self): |