# HG changeset patch # User David Soria Parra # Date 2012-05-13 09:54:58 # Node ID f8dee1a8f844fa4979b6976f9ab4447cecbd753d # Parent a270ec977ba69039c748cdcc34ca19d8f7487828 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 diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- 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)