mercurial/namespaces.py
changeset 36592 b0054f3c055a
parent 35212 c7b45db8f317
child 36593 900e5ee44307
--- a/mercurial/namespaces.py	Sun Feb 25 16:45:44 2018 +0900
+++ b/mercurial/namespaces.py	Sun Feb 25 18:56:06 2018 +0900
@@ -2,6 +2,7 @@
 
 from .i18n import _
 from . import (
+    registrar,
     templatekw,
     util,
 )
@@ -87,11 +88,11 @@
 
         # we only generate a template keyword if one does not already exist
         if namespace.name not in templatekw.keywords:
+            templatekeyword = registrar.templatekeyword(templatekw.keywords)
+            @templatekeyword(namespace.name)
             def generatekw(**args):
                 return templatekw.shownames(namespace.name, **args)
 
-            templatekw.keywords[namespace.name] = generatekw
-
     def singlenode(self, repo, name):
         """
         Return the 'best' node for the given name. Best means the first node