Mercurial > jhg
diff src/org/tmatesoft/hg/repo/HgRepository.java @ 220:8de327242aa0
Basic information about branches
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 19 May 2011 04:14:45 +0200 |
parents | 706bcc7cfee4 |
children | 1ec6b327a6ac |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgRepository.java Tue May 17 05:43:09 2011 +0200 +++ b/src/org/tmatesoft/hg/repo/HgRepository.java Thu May 19 04:14:45 2011 +0200 @@ -34,6 +34,7 @@ import org.tmatesoft.hg.util.FileWalker; import org.tmatesoft.hg.util.Path; import org.tmatesoft.hg.util.PathRewrite; +import org.tmatesoft.hg.util.ProgressSupport; @@ -65,13 +66,15 @@ private HgChangelog changelog; private HgManifest manifest; private HgTags tags; + private HgBranches branches; + // XXX perhaps, shall enable caching explicitly private final HashMap<Path, SoftReference<RevlogStream>> streamsCache = new HashMap<Path, SoftReference<RevlogStream>>(); private final org.tmatesoft.hg.internal.Internals impl = new org.tmatesoft.hg.internal.Internals(); private HgIgnore ignore; private ConfigFile configFile; - + HgRepository(String repositoryPath) { repoDir = null; repoLocation = repositoryPath; @@ -151,6 +154,14 @@ return tags; } + public final HgBranches getBranches() { + if (branches == null) { + branches = new HgBranches(this); + branches.collect(ProgressSupport.Factory.get(null)); + } + return branches; + } + public HgDataFile getFileNode(String path) { String nPath = normalizePath.rewrite(path); String storagePath = dataPathHelper.rewrite(nPath);