Mercurial > hg
changeset 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 | 40fcf6c05217 |
files | mercurial/namespaces.py |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/namespaces.py Mon Dec 15 00:24:23 2014 -0800 +++ b/mercurial/namespaces.py Sun Dec 14 18:54:50 2014 -0800 @@ -96,3 +96,8 @@ def templatename(self, namespace): """method that returns the template name of a namespace""" return self._names[namespace]['templatename'] + + def names(self, repo, namespace, node): + """method that returns a (sorted) list of names in a namespace that + match a given node""" + return sorted(self._names[namespace]['nodemap'](repo, node))