namespaces: add method to get template name of namespace
authorSean Farley <sean.michael.farley@gmail.com>
Sun, 14 Dec 2014 19:12:27 -0800
changeset 23606 80e3cbe227d1
parent 23605 4c4c967814ef
child 23607 0fd778ef0f61
namespaces: add method to get template name of namespace This patch adds the public api for getting the template name of a namespace so that the next patch can use it to generate a template keyword automatically.
mercurial/namespaces.py
--- a/mercurial/namespaces.py	Mon Dec 15 00:09:52 2014 -0800
+++ b/mercurial/namespaces.py	Sun Dec 14 19:12:27 2014 -0800
@@ -84,3 +84,7 @@
                     return cl.node(maxrev)
                 return n[0]
         raise KeyError(_('no such name: %s') % name)
+
+    def templatename(self, namespace):
+        """method that returns the template name of a namespace"""
+        return self._names[namespace]['templatename']