# HG changeset patch # User Sean Farley # Date 2014-12-15 22:46:04 # Node ID b9537ee87961d88dea449a2fc69143c0fdaf1ae6 # Parent c517b97c7609721a2319d92f4cb2c3eadf1ff00c namespaces: add method to return a list of nodes for a given name This is a helpful method that some extensions can make use of (e.g. for custom revsets); currently not used in core. diff --git a/mercurial/namespaces.py b/mercurial/namespaces.py --- a/mercurial/namespaces.py +++ b/mercurial/namespaces.py @@ -140,3 +140,10 @@ class namespace(object): """method that returns a (sorted) list of names in a namespace that match a given node""" return sorted(self.nodemap(repo, node)) + + def nodes(self, repo, name): + """method that returns a list of nodes in a namespace that + match a given name. + + """ + return sorted(self.namemap(repo, name))