Mercurial > hg-stable
changeset 42370:de65ae32b82d
templatekw: change default value of 'requires' to ()
Since we dropped support for the old-style template keywords, we no longer
have to distinguish None (old-style) and an empty requirement (new-style).
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 20 May 2019 08:40:54 +0900 |
parents | 6310180662f5 |
children | ffab9eed3921 |
files | mercurial/registrar.py |
diffstat | 1 files changed, 2 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/registrar.py Tue May 14 16:30:38 2019 -0700 +++ b/mercurial/registrar.py Mon May 20 08:40:54 2019 +0900 @@ -341,9 +341,7 @@ The first string argument is used also in online help. Optional argument 'requires' should be a collection of resource names - which the template keyword depends on. This also serves as a flag to - switch to the new API. If 'requires' is unspecified, all template - keywords and resources are expanded to the function arguments. + which the template keyword depends on. 'templatekeyword' instance in example above can be used to decorate multiple functions. @@ -355,7 +353,7 @@ Otherwise, explicit 'templatekw.loadkeyword()' is needed. """ - def _extrasetup(self, name, func, requires=None): + def _extrasetup(self, name, func, requires=()): func._requires = requires class templatefilter(_templateregistrarbase):