diff mercurial/dispatch.py @ 28538:009f58f1ea75

registrar: add templatekeyword to mark a function as template keyword (API) _templateregistrarbase is defined as a super class of templatekeyword, for ease of adding template common features between "keyword", "filter" and "function". This patch also adds loadkeyword() to templatekw, because this combination helps to figure out how they cooperate with each other. Listing up loadkeyword() in dispatch.extraloaders causes implicit loading template keyword functions at loading (3rd party) extension. This change requires that "templatekeyword" attribute of (3rd party) extension is registrar.templatekeyword or so.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sun, 13 Mar 2016 05:17:06 +0900
parents 293adbaa14a7
children d856e85a8a7a
line wrap: on
line diff
--- a/mercurial/dispatch.py	Wed Mar 16 11:57:09 2016 +0000
+++ b/mercurial/dispatch.py	Sun Mar 13 05:17:06 2016 +0900
@@ -35,6 +35,7 @@
     hg,
     hook,
     revset,
+    templatekw,
     ui as uimod,
     util,
 )
@@ -758,6 +759,7 @@
     ('cmdtable', commands, 'loadcmdtable'),
     ('filesetpredicate', fileset, 'loadpredicate'),
     ('revsetpredicate', revset, 'loadpredicate'),
+    ('templatekeyword', templatekw, 'loadkeyword'),
 ]
 
 def _dispatch(req):