changeset 16707:f8dee1a8f844

localrepo: introduce bookmarkheads Similar to branch heads we introduce the notion of bookmarkheads. Bookmarkheads are changests that are bookmarked with the given bookmark or a diverged version
author David Soria Parra <dsp@php.net>
date Sun, 13 May 2012 11:54:58 +0200
parents a270ec977ba6
children 4a02cf4fbb2e
files mercurial/localrepo.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sat May 12 21:28:10 2012 +0200
+++ b/mercurial/localrepo.py	Sun May 13 11:54:58 2012 +0200
@@ -180,6 +180,14 @@
     def _writebookmarks(self, marks):
       bookmarks.write(self)
 
+    def bookmarkheads(self, bookmark):
+        name = bookmark.split('@', 1)[0]
+        heads = []
+        for mark, n in self._bookmarks.iteritems():
+            if mark.split('@', 1)[0] == name:
+                heads.append(n)
+        return heads
+
     @storecache('phaseroots')
     def _phasecache(self):
         return phases.phasecache(self, self._phasedefaults)