Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 37848:6e2259847f5f
bookmarks: extract function that looks up bookmark names by node
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 05 May 2018 11:34:03 +0900 |
parents | 856f381ad74b |
children | 1cba497491be |
comparison
equal
deleted
inserted
replaced
37847:8256962e798c | 37848:6e2259847f5f |
---|---|
1027 self._tagscache.nodetagscache = nodetagscache | 1027 self._tagscache.nodetagscache = nodetagscache |
1028 return self._tagscache.nodetagscache.get(node, []) | 1028 return self._tagscache.nodetagscache.get(node, []) |
1029 | 1029 |
1030 def nodebookmarks(self, node): | 1030 def nodebookmarks(self, node): |
1031 """return the list of bookmarks pointing to the specified node""" | 1031 """return the list of bookmarks pointing to the specified node""" |
1032 marks = [] | 1032 return self._bookmarks.names(node) |
1033 for bookmark, n in self._bookmarks.iteritems(): | |
1034 if n == node: | |
1035 marks.append(bookmark) | |
1036 return sorted(marks) | |
1037 | 1033 |
1038 def branchmap(self): | 1034 def branchmap(self): |
1039 '''returns a dictionary {branch: [branchheads]} with branchheads | 1035 '''returns a dictionary {branch: [branchheads]} with branchheads |
1040 ordered by increasing revision number''' | 1036 ordered by increasing revision number''' |
1041 branchmap.updatecache(self) | 1037 branchmap.updatecache(self) |