[PATCH 2 of 7 V2] namespaces: add method to get template name of namespace
Sean Farley
sean.michael.farley at gmail.com
Thu Dec 18 15:10:46 CST 2014
# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1418613147 28800
# Sun Dec 14 19:12:27 2014 -0800
# Node ID 873ba6dc401458b59c14cec91b9729d36064b8e3
# Parent 5b61f147d886111e0e783b01342e864af67e2af7
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.
diff --git a/mercurial/namespaces.py b/mercurial/namespaces.py
--- a/mercurial/namespaces.py
+++ b/mercurial/namespaces.py
@@ -82,5 +82,9 @@ class namespaces(object):
cl = repo.changelog
maxrev = max(cl.rev(node) for node in n)
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']
More information about the Mercurial-devel
mailing list