diff 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
line wrap: on
line diff
--- a/mercurial/dispatch.py	Sun Feb 14 20:43:30 2016 +0900
+++ b/mercurial/dispatch.py	Wed Mar 30 02:10:44 2016 +0900
@@ -35,6 +35,7 @@
     hg,
     hook,
     revset,
+    templatefilters,
     templatekw,
     ui as uimod,
     util,
@@ -766,6 +767,7 @@
     ('cmdtable', commands, 'loadcmdtable'),
     ('filesetpredicate', fileset, 'loadpredicate'),
     ('revsetpredicate', revset, 'loadpredicate'),
+    ('templatefilter', templatefilters, 'loadfilter'),
     ('templatekeyword', templatekw, 'loadkeyword'),
 ]