Mercurial > public > mercurial-scm > hg
comparison mercurial/namespaces.py @ 23606:80e3cbe227d1
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.
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Sun, 14 Dec 2014 19:12:27 -0800 |
parents | 4c4c967814ef |
children | 0fd778ef0f61 |
comparison
equal
deleted
inserted
replaced
23605:4c4c967814ef | 23606:80e3cbe227d1 |
---|---|
82 cl = repo.changelog | 82 cl = repo.changelog |
83 maxrev = max(cl.rev(node) for node in n) | 83 maxrev = max(cl.rev(node) for node in n) |
84 return cl.node(maxrev) | 84 return cl.node(maxrev) |
85 return n[0] | 85 return n[0] |
86 raise KeyError(_('no such name: %s') % name) | 86 raise KeyError(_('no such name: %s') % name) |
87 | |
88 def templatename(self, namespace): | |
89 """method that returns the template name of a namespace""" | |
90 return self._names[namespace]['templatename'] |