comparison src/org/tmatesoft/hg/repo/HgRepository.java @ 239:df9d2854d3d6

Initial access to subrepositories
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 16 Jun 2011 04:23:51 +0200
parents 6e1373b54e9b
children a6d19adc2636
comparison
equal deleted inserted replaced
238:4817d4ccc50e 239:df9d2854d3d6
34 import org.tmatesoft.hg.internal.DataAccessProvider; 34 import org.tmatesoft.hg.internal.DataAccessProvider;
35 import org.tmatesoft.hg.internal.Experimental; 35 import org.tmatesoft.hg.internal.Experimental;
36 import org.tmatesoft.hg.internal.Filter; 36 import org.tmatesoft.hg.internal.Filter;
37 import org.tmatesoft.hg.internal.RequiresFile; 37 import org.tmatesoft.hg.internal.RequiresFile;
38 import org.tmatesoft.hg.internal.RevlogStream; 38 import org.tmatesoft.hg.internal.RevlogStream;
39 import org.tmatesoft.hg.internal.SubrepoManager;
39 import org.tmatesoft.hg.util.CancelledException; 40 import org.tmatesoft.hg.util.CancelledException;
40 import org.tmatesoft.hg.util.Pair; 41 import org.tmatesoft.hg.util.Pair;
41 import org.tmatesoft.hg.util.Path; 42 import org.tmatesoft.hg.util.Path;
42 import org.tmatesoft.hg.util.PathRewrite; 43 import org.tmatesoft.hg.util.PathRewrite;
43 import org.tmatesoft.hg.util.ProgressSupport; 44 import org.tmatesoft.hg.util.ProgressSupport;
73 private HgChangelog changelog; 74 private HgChangelog changelog;
74 private HgManifest manifest; 75 private HgManifest manifest;
75 private HgTags tags; 76 private HgTags tags;
76 private HgBranches branches; 77 private HgBranches branches;
77 private HgMergeState mergeState; 78 private HgMergeState mergeState;
79 private SubrepoManager subRepos;
78 80
79 // XXX perhaps, shall enable caching explicitly 81 // XXX perhaps, shall enable caching explicitly
80 private final HashMap<Path, SoftReference<RevlogStream>> streamsCache = new HashMap<Path, SoftReference<RevlogStream>>(); 82 private final HashMap<Path, SoftReference<RevlogStream>> streamsCache = new HashMap<Path, SoftReference<RevlogStream>>();
81 83
82 private final org.tmatesoft.hg.internal.Internals impl = new org.tmatesoft.hg.internal.Internals(); 84 private final org.tmatesoft.hg.internal.Internals impl = new org.tmatesoft.hg.internal.Internals();
239 * @return location where user files (shall) reside 241 * @return location where user files (shall) reside
240 */ 242 */
241 public File getWorkingDir() { 243 public File getWorkingDir() {
242 return workingDir; 244 return workingDir;
243 } 245 }
246
247 /**
248 * Provides access to sub-repositories defined in this repository. Enumerated sub-repositories are those directly
249 * known, not recursive collection of all nested sub-repositories.
250 * @return list of all known sub-repositories in this repository, or empty list if none found.
251 */
252 public List<HgSubrepoLocation> getSubrepositories() {
253 if (subRepos == null) {
254 subRepos = new SubrepoManager(this);
255 }
256 return subRepos.all();
257 }
244 258
245 // shall be of use only for internal classes 259 // shall be of use only for internal classes
246 /*package-local*/ File getRepositoryRoot() { 260 /*package-local*/ File getRepositoryRoot() {
247 return repoDir; 261 return repoDir;
248 } 262 }