diff mercurial/namespaces.py @ 23563:114992041625

namespaces: add branches Note that the exception-catching from the previous branchtip check is moved up to catch exceptions from the try block surrounding the namespace lookup.
author Sean Farley <sean.michael.farley@gmail.com>
date Fri, 17 Oct 2014 15:27:12 -0700
parents 59e703aecaf6
children 4c4c967814ef
line wrap: on
line diff
--- a/mercurial/namespaces.py	Fri Oct 17 15:27:33 2014 -0700
+++ b/mercurial/namespaces.py	Fri Oct 17 15:27:12 2014 -0700
@@ -44,6 +44,9 @@
         addns("tags",
               lambda repo, name: tolist(repo._tagscache.tags.get(name)))
 
+        addns("branches",
+              lambda repo, name: tolist(repo.branchtip(name)))
+
     def addnamespace(self, namespace, namemap, order=None):
         """
         register a namespace