comparison mercurial/dispatch.py @ 28692:6b3b958daf03

registrar: add templatefilter to mark a function as template filter (API) This patch also adds loadfilter() to templatefilters, because this combination helps to figure out how they cooperate with each other. Listing up loadfilter() in dispatch.extraloaders causes implicit loading template filter functions at loading (3rd party) extension. This change requires that "templatefilter" attribute of (3rd party) extension is registrar.templatefilter or so.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 30 Mar 2016 02:10:44 +0900
parents 38dc3f28f478
children cc103bd0dbf9
comparison
equal deleted inserted replaced
28691:a04baf9c063b 28692:6b3b958daf03
33 fancyopts, 33 fancyopts,
34 fileset, 34 fileset,
35 hg, 35 hg,
36 hook, 36 hook,
37 revset, 37 revset,
38 templatefilters,
38 templatekw, 39 templatekw,
39 ui as uimod, 40 ui as uimod,
40 util, 41 util,
41 ) 42 )
42 43
764 # extraobj) arguments 765 # extraobj) arguments
765 extraloaders = [ 766 extraloaders = [
766 ('cmdtable', commands, 'loadcmdtable'), 767 ('cmdtable', commands, 'loadcmdtable'),
767 ('filesetpredicate', fileset, 'loadpredicate'), 768 ('filesetpredicate', fileset, 'loadpredicate'),
768 ('revsetpredicate', revset, 'loadpredicate'), 769 ('revsetpredicate', revset, 'loadpredicate'),
770 ('templatefilter', templatefilters, 'loadfilter'),
769 ('templatekeyword', templatekw, 'loadkeyword'), 771 ('templatekeyword', templatekw, 'loadkeyword'),
770 ] 772 ]
771 773
772 def _dispatch(req): 774 def _dispatch(req):
773 args = req.args 775 args = req.args