mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 00:14:35 +03:00
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.
This commit is contained in:
parent
0eb677308a
commit
01b442aa2a
@ -96,3 +96,8 @@ class namespaces(object):
|
||||
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))
|
||||
|
Loading…
Reference in New Issue
Block a user