Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/HgRepository.java @ 414:bb278ccf9866
Pull changes from smartgit3 branch
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Wed, 21 Mar 2012 20:51:12 +0100 |
| parents | 866fc3b597a0 63c5a9d7ca3f |
| children | 528b6780a8bd |
comparison
equal
deleted
inserted
replaced
| 413:7f27122011c3 | 414:bb278ccf9866 |
|---|---|
| 33 import org.tmatesoft.hg.internal.ByteArrayChannel; | 33 import org.tmatesoft.hg.internal.ByteArrayChannel; |
| 34 import org.tmatesoft.hg.internal.ConfigFile; | 34 import org.tmatesoft.hg.internal.ConfigFile; |
| 35 import org.tmatesoft.hg.internal.DataAccessProvider; | 35 import org.tmatesoft.hg.internal.DataAccessProvider; |
| 36 import org.tmatesoft.hg.internal.Experimental; | 36 import org.tmatesoft.hg.internal.Experimental; |
| 37 import org.tmatesoft.hg.internal.Filter; | 37 import org.tmatesoft.hg.internal.Filter; |
| 38 import org.tmatesoft.hg.internal.Internals; | |
| 38 import org.tmatesoft.hg.internal.RevlogStream; | 39 import org.tmatesoft.hg.internal.RevlogStream; |
| 39 import org.tmatesoft.hg.internal.SubrepoManager; | 40 import org.tmatesoft.hg.internal.SubrepoManager; |
| 40 import org.tmatesoft.hg.util.CancelledException; | 41 import org.tmatesoft.hg.util.CancelledException; |
| 41 import org.tmatesoft.hg.util.Pair; | 42 import org.tmatesoft.hg.util.Pair; |
| 42 import org.tmatesoft.hg.util.Path; | 43 import org.tmatesoft.hg.util.Path; |
| 167 } | 168 } |
| 168 | 169 |
| 169 public HgManifest getManifest() { | 170 public HgManifest getManifest() { |
| 170 if (manifest == null) { | 171 if (manifest == null) { |
| 171 RevlogStream content = resolve(Path.create(repoPathHelper.rewrite("00manifest.i")), true); | 172 RevlogStream content = resolve(Path.create(repoPathHelper.rewrite("00manifest.i")), true); |
| 172 manifest = new HgManifest(this, content); | 173 manifest = new HgManifest(this, content, impl.buildFileNameEncodingHelper()); |
| 173 } | 174 } |
| 174 return manifest; | 175 return manifest; |
| 175 } | 176 } |
| 176 | 177 |
| 177 public HgTags getTags() throws HgInvalidControlFileException { | 178 public HgTags getTags() throws HgInvalidControlFileException { |
| 330 return path.toString().toLowerCase(); | 331 return path.toString().toLowerCase(); |
| 331 } | 332 } |
| 332 }; | 333 }; |
| 333 } | 334 } |
| 334 HgDirstate ds = new HgDirstate(this, new File(repoDir, "dirstate"), pathPool, canonicalPath); | 335 HgDirstate ds = new HgDirstate(this, new File(repoDir, "dirstate"), pathPool, canonicalPath); |
| 335 ds.read(); | 336 ds.read(impl.buildFileNameEncodingHelper()); |
| 336 return ds; | 337 return ds; |
| 337 } | 338 } |
| 338 | 339 |
| 339 /** | 340 /** |
| 340 * Access to configured set of ignored files. | 341 * Access to configured set of ignored files. |
| 341 * @see HgIgnore#isIgnored(Path) | 342 * @see HgIgnore#isIgnored(Path) |
| 342 */ | 343 */ |
| 343 public HgIgnore getIgnore() /*throws HgInvalidControlFileException */{ | 344 public HgIgnore getIgnore() /*throws HgInvalidControlFileException */{ |
| 344 // TODO read config for additional locations | 345 // TODO read config for additional locations |
| 345 if (ignore == null) { | 346 if (ignore == null) { |
| 346 ignore = new HgIgnore(); | 347 ignore = new HgIgnore(getToRepoPathHelper()); |
| 347 File ignoreFile = new File(getWorkingDir(), ".hgignore"); | 348 File ignoreFile = new File(getWorkingDir(), ".hgignore"); |
| 348 try { | 349 try { |
| 349 final List<String> errors = ignore.read(ignoreFile); | 350 final List<String> errors = ignore.read(ignoreFile); |
| 350 if (errors != null) { | 351 if (errors != null) { |
| 351 getContext().getLog().warn(getClass(), "Syntax errors parsing .hgignore:\n%s", errors); | 352 getContext().getLog().warn(getClass(), "Syntax errors parsing .hgignore:\n%s", Internals.join(errors, ",\n")); |
| 352 } | 353 } |
| 353 } catch (IOException ex) { | 354 } catch (IOException ex) { |
| 354 final String m = "Error reading .hgignore file"; | 355 final String m = "Error reading .hgignore file"; |
| 355 getContext().getLog().warn(getClass(), ex, m); | 356 getContext().getLog().warn(getClass(), ex, m); |
| 356 // throw new HgInvalidControlFileException(m, ex, ignoreFile); | 357 // throw new HgInvalidControlFileException(m, ex, ignoreFile); |
| 407 } | 408 } |
| 408 | 409 |
| 409 /*package-local*/ SessionContext getContext() { | 410 /*package-local*/ SessionContext getContext() { |
| 410 return sessionContext; | 411 return sessionContext; |
| 411 } | 412 } |
| 413 | |
| 414 /*package-local*/ Internals getImplHelper() { | |
| 415 return impl; | |
| 416 } | |
| 412 | 417 |
| 413 private List<Filter> instantiateFilters(Path p, Filter.Options opts) { | 418 private List<Filter> instantiateFilters(Path p, Filter.Options opts) { |
| 414 List<Filter.Factory> factories = impl.getFilters(this); | 419 List<Filter.Factory> factories = impl.getFilters(this); |
| 415 if (factories.isEmpty()) { | 420 if (factories.isEmpty()) { |
| 416 return Collections.emptyList(); | 421 return Collections.emptyList(); |
