namespaces: add tags
authorSean Farley <sean.michael.farley@gmail.com>
Fri, 17 Oct 2014 15:27:33 -0700
changeset 23562 59e703aecaf6
parent 23561 3c2419e07df5
child 23563 114992041625
namespaces: add tags
mercurial/context.py
mercurial/namespaces.py
--- a/mercurial/context.py	Sun Dec 14 19:11:44 2014 -0800
+++ b/mercurial/context.py	Fri Oct 17 15:27:33 2014 -0700
@@ -415,10 +415,6 @@
             except KeyError:
                 pass
 
-            if changeid in repo._tagscache.tags:
-                self._node = repo._tagscache.tags[changeid]
-                self._rev = repo.changelog.rev(self._node)
-                return
             try:
                 self._node = repo.branchtip(changeid)
                 self._rev = repo.changelog.rev(self._node)
--- a/mercurial/namespaces.py	Sun Dec 14 19:11:44 2014 -0800
+++ b/mercurial/namespaces.py	Fri Oct 17 15:27:33 2014 -0700
@@ -34,10 +34,15 @@
     def __init__(self):
         self._names = util.sortdict()
 
+        addns = self.addnamespace
+
         # we need current mercurial named objects (bookmarks, tags, and
         # branches) to be initialized somewhere, so that place is here
-        self.addnamespace("bookmarks",
-                          lambda repo, name: tolist(repo._bookmarks.get(name)))
+        addns("bookmarks",
+              lambda repo, name: tolist(repo._bookmarks.get(name)))
+
+        addns("tags",
+              lambda repo, name: tolist(repo._tagscache.tags.get(name)))
 
     def addnamespace(self, namespace, namemap, order=None):
         """