diff hgext3rd/evolve/exthelper.py @ 2926:1abafae41fe2

evolve: use registrar.templatekeyword to register template keyword functions Now, using registrar.templatekeyword of Mercurial directly in evolve extension should be safe enough. because it has been available since Mercurial 3.8, and minimum Mercurial version for evolve extension is 3.8, too. BTW, this also fixes an issue of "hg help templates" output that template keywords "precursors" and "successors" are not displayed as same as others, because they do not have ":KEYWORD:" prefix in their docstring.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Mon, 07 Aug 2017 23:22:41 +0900
parents 9efedcedd9dd
children
line wrap: on
line diff
--- a/hgext3rd/evolve/exthelper.py	Sun Sep 10 20:06:52 2017 +0900
+++ b/hgext3rd/evolve/exthelper.py	Mon Aug 07 23:22:41 2017 +0900
@@ -99,8 +99,11 @@
             revsetpredicate(name)(symbol)
         revset.loadpredicate(ui, 'evolve', revsetpredicate)
 
+        templatekeyword = registrar.templatekeyword()
         for name, kw in self._templatekws:
-            templatekw.keywords[name] = kw
+            templatekeyword(name)(kw)
+        templatekw.loadkeyword(ui, 'evolve', templatekeyword)
+
         for ext, command, wrapper, opts in self._extcommandwrappers:
             if ext not in knownexts:
                 try: