Mercurial > hg
comparison mercurial/registrar.py @ 38930:382b055cc358
templatekw: deprecate old-style template keyword function (API)
.. api::
`f(**kwargs)` style template keyword function is deprecated. Switch to
new `(context, mapping)` API by declaring resource requirements.
The new-style API will be the default in Mercurial 4.9. See
registrar.templatekeyword for details.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 25 Feb 2018 21:04:33 +0900 |
parents | 61ab546b71c3 |
children | 5d3b58472660 |
comparison
equal
deleted
inserted
replaced
38929:d7e6e109eaae | 38930:382b055cc358 |
---|---|
293 def mykeywordfunc(context, mapping): | 293 def mykeywordfunc(context, mapping): |
294 '''Explanation of this template keyword .... | 294 '''Explanation of this template keyword .... |
295 ''' | 295 ''' |
296 pass | 296 pass |
297 | 297 |
298 # old API | 298 # old API (DEPRECATED) |
299 @templatekeyword('mykeyword') | 299 @templatekeyword('mykeyword') |
300 def mykeywordfunc(repo, ctx, templ, cache, revcache, **args): | 300 def mykeywordfunc(repo, ctx, templ, cache, revcache, **args): |
301 '''Explanation of this template keyword .... | 301 '''Explanation of this template keyword .... |
302 ''' | 302 ''' |
303 pass | 303 pass |