comparison mercurial/dispatch.py @ 28695:cc103bd0dbf9

registrar: add templatefunc to mark a function as template function (API) This patch also adds loadfunction() to templater, because this combination helps to figure out how they cooperate with each other. Listing up loadfunction() in dispatch.extraloaders causes implicit loading template function at loading (3rd party) extension. This patch explicitly tests whether templatefunc decorator works as expected, because there is no bundled extension, which defines template function. This change requires that "templatefunc" attribute of (3rd party) extension is registrar.templatefunc or so.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 30 Mar 2016 02:10:44 +0900
parents 6b3b958daf03
children 09750b1231c2
comparison
equal deleted inserted replaced
28694:9a6fa1d93bc8 28695:cc103bd0dbf9
35 hg, 35 hg,
36 hook, 36 hook,
37 revset, 37 revset,
38 templatefilters, 38 templatefilters,
39 templatekw, 39 templatekw,
40 templater,
40 ui as uimod, 41 ui as uimod,
41 util, 42 util,
42 ) 43 )
43 44
44 class request(object): 45 class request(object):
766 extraloaders = [ 767 extraloaders = [
767 ('cmdtable', commands, 'loadcmdtable'), 768 ('cmdtable', commands, 'loadcmdtable'),
768 ('filesetpredicate', fileset, 'loadpredicate'), 769 ('filesetpredicate', fileset, 'loadpredicate'),
769 ('revsetpredicate', revset, 'loadpredicate'), 770 ('revsetpredicate', revset, 'loadpredicate'),
770 ('templatefilter', templatefilters, 'loadfilter'), 771 ('templatefilter', templatefilters, 'loadfilter'),
772 ('templatefunc', templater, 'loadfunction'),
771 ('templatekeyword', templatekw, 'loadkeyword'), 773 ('templatekeyword', templatekw, 'loadkeyword'),
772 ] 774 ]
773 775
774 def _dispatch(req): 776 def _dispatch(req):
775 args = req.args 777 args = req.args