Mercurial > hg4j
diff src/org/tmatesoft/hg/repo/HgRepository.java @ 231:1792b37650f2
Introduced access to conflict resolution information (merge state)
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 01 Jun 2011 05:44:25 +0200 |
parents | 1ec6b327a6ac |
children | b2cfbe46f9b6 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgRepository.java Tue May 31 05:33:16 2011 +0200 +++ b/src/org/tmatesoft/hg/repo/HgRepository.java Wed Jun 01 05:44:25 2011 +0200 @@ -26,6 +26,7 @@ import org.tmatesoft.hg.internal.ConfigFile; import org.tmatesoft.hg.internal.DataAccessProvider; +import org.tmatesoft.hg.internal.Experimental; import org.tmatesoft.hg.internal.Filter; import org.tmatesoft.hg.internal.RequiresFile; import org.tmatesoft.hg.internal.RevlogStream; @@ -64,6 +65,7 @@ private HgManifest manifest; private HgTags tags; private HgBranches branches; + private HgMergeState mergeState; // XXX perhaps, shall enable caching explicitly private final HashMap<Path, SoftReference<RevlogStream>> streamsCache = new HashMap<Path, SoftReference<RevlogStream>>(); @@ -138,7 +140,7 @@ return this.manifest; } - public final HgTags getTags() { + public HgTags getTags() { if (tags == null) { tags = new HgTags(); try { @@ -151,13 +153,21 @@ return tags; } - public final HgBranches getBranches() { + public HgBranches getBranches() { if (branches == null) { branches = new HgBranches(this); branches.collect(ProgressSupport.Factory.get(null)); } return branches; } + + @Experimental(reason="Perhaps, shall not cache instance, and provide loadMergeState as it may change often") + public HgMergeState getMergeState() { + if (mergeState == null) { + mergeState = new HgMergeState(this); + } + return mergeState; + } public HgDataFile getFileNode(String path) { String nPath = normalizePath.rewrite(path);