--- a/mercurial/context.py Sun Feb 13 11:14:46 2011 +0100
+++ b/mercurial/context.py Fri Feb 11 19:36:15 2011 +0100
@@ -114,6 +114,8 @@
return self._changeset[5]
def tags(self):
return self._repo.nodetags(self._node)
+ def bookmarks(self):
+ return self._repo.nodebookmarks(self._node)
def parents(self):
"""return contexts for each parent changeset"""
--- a/mercurial/localrepo.py Sun Feb 13 11:14:46 2011 +0100
+++ b/mercurial/localrepo.py Fri Feb 11 19:36:15 2011 +0100
@@ -399,6 +399,13 @@
tags.sort()
return self.nodetagscache.get(node, [])
+ def nodebookmarks(self, node):
+ marks = []
+ for bookmark, n in self._bookmarks.iteritems():
+ if n == node:
+ marks.append(bookmark)
+ return sorted(marks)
+
def _branchtags(self, partial, lrev):
# TODO: rename this function?
tiprev = len(self) - 1