From 2ce902d4349e062210a721082ef08c8e08003a99 Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Sun, 13 May 2012 11:54:58 +0200 Subject: [PATCH] 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 --- mercurial/localrepo.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py index 8b5baac8b4..de23ce77b5 100644 --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -180,6 +180,14 @@ class localrepository(repo.repository): 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)