comparison mercurial/namespaces.py @ 23608:807ee1a02bb0

namespaces: add names method to return list of names for a given node In the previous patch, we added a node-to-name map property. This patch just exposes that interface to the api.
author Sean Farley <sean.michael.farley@gmail.com>
date Sun, 14 Dec 2014 18:54:50 -0800
parents 0fd778ef0f61
children 9266d1dd6a6e
comparison
equal deleted inserted replaced
23607:0fd778ef0f61 23608:807ee1a02bb0
94 raise KeyError(_('no such name: %s') % name) 94 raise KeyError(_('no such name: %s') % name)
95 95
96 def templatename(self, namespace): 96 def templatename(self, namespace):
97 """method that returns the template name of a namespace""" 97 """method that returns the template name of a namespace"""
98 return self._names[namespace]['templatename'] 98 return self._names[namespace]['templatename']
99
100 def names(self, repo, namespace, node):
101 """method that returns a (sorted) list of names in a namespace that
102 match a given node"""
103 return sorted(self._names[namespace]['nodemap'](repo, node))