comparison mercurial/namespaces.py @ 23562:59e703aecaf6

namespaces: add tags
author Sean Farley <sean.michael.farley@gmail.com>
date Fri, 17 Oct 2014 15:27:33 -0700
parents 3c2419e07df5
children 114992041625
comparison
equal deleted inserted replaced
23561:3c2419e07df5 23562:59e703aecaf6
32 _names_version = 0 32 _names_version = 0
33 33
34 def __init__(self): 34 def __init__(self):
35 self._names = util.sortdict() 35 self._names = util.sortdict()
36 36
37 addns = self.addnamespace
38
37 # we need current mercurial named objects (bookmarks, tags, and 39 # we need current mercurial named objects (bookmarks, tags, and
38 # branches) to be initialized somewhere, so that place is here 40 # branches) to be initialized somewhere, so that place is here
39 self.addnamespace("bookmarks", 41 addns("bookmarks",
40 lambda repo, name: tolist(repo._bookmarks.get(name))) 42 lambda repo, name: tolist(repo._bookmarks.get(name)))
43
44 addns("tags",
45 lambda repo, name: tolist(repo._tagscache.tags.get(name)))
41 46
42 def addnamespace(self, namespace, namemap, order=None): 47 def addnamespace(self, namespace, namemap, order=None):
43 """ 48 """
44 register a namespace 49 register a namespace
45 50