diff mercurial/localrepo.py @ 13384:caa561759538

context: add method to return all bookmarks pointing to a node
author David Soria Parra <dsp@php.net>
date Fri, 11 Feb 2011 19:36:15 +0100
parents f1c5294e9119
children d012d95499f7
line wrap: on
line diff
--- 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