Mercurial > jhg
diff src/org/tmatesoft/hg/repo/HgRepository.java @ 484:ae4d6604debd
Bookmarks support added
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 08 Aug 2012 14:41:44 +0200 |
parents | e31e85cf4d4c |
children | d740edfff563 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgRepository.java Tue Aug 07 19:14:53 2012 +0200 +++ b/src/org/tmatesoft/hg/repo/HgRepository.java Wed Aug 08 14:41:44 2012 +0200 @@ -111,6 +111,7 @@ private HgBranches branches; private HgMergeState mergeState; private SubrepoManager subRepos; + private HgBookmarks bookmarks; // XXX perhaps, shall enable caching explicitly private final HashMap<Path, SoftReference<RevlogStream>> streamsCache = new HashMap<Path, SoftReference<RevlogStream>>(); @@ -233,6 +234,8 @@ } /** + * Access branch information + * @return branch manager instance, never <code>null</code> * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em> */ public HgBranches getBranches() throws HgInvalidControlFileException { @@ -243,6 +246,10 @@ return branches; } + /** + * Access state of the recent merge + * @return merge state facility, never <code>null</code> + */ public HgMergeState getMergeState() { if (mergeState == null) { mergeState = new HgMergeState(this); @@ -413,6 +420,19 @@ } } } + + /** + * Access bookmarks-related functionality + * @return facility to manage bookmarks, never <code>null</code> + * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em> + */ + public HgBookmarks getBookmarks() throws HgInvalidControlFileException { + if (bookmarks == null) { + bookmarks = new HgBookmarks(this); + bookmarks.read(); + } + return bookmarks; + } /*package-local*/ DataAccessProvider getDataAccess() { return dataAccess;