Comments
Patch
@@ -1,7 +1,8 @@
from i18n import _
from mercurial import util
+import templatekw
def tolist(val):
"""
a convenience method to return an empty list instead of None
"""
@@ -72,10 +73,17 @@ class namespaces(object):
if order is not None:
self._names.insert(order, namespace, val)
else:
self._names[namespace] = val
+ # we only generate a template keyword if one does not already exist
+ if namespace not in templatekw.keywords:
+ def generatekw(**args):
+ return templatekw.shownames(namespace, **args)
+
+ templatekw.keywords[namespace] = generatekw
+
def singlenode(self, repo, name):
"""
Return the 'best' node for the given name. Best means the first node
in the first nonempty list returned by a name-to-nodes mapping function
in the defined precedence order.