Mercurial > hg4j
comparison src/org/tmatesoft/hg/internal/Internals.java @ 425:48f993aa2f41
FIXMEs: exceptions, javadoc
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 28 Mar 2012 18:39:29 +0200 |
parents | fdd7d756dea0 |
children | 909306e412e2 |
comparison
equal
deleted
inserted
replaced
424:6437d261048a | 425:48f993aa2f41 |
---|---|
30 import java.util.List; | 30 import java.util.List; |
31 import java.util.StringTokenizer; | 31 import java.util.StringTokenizer; |
32 | 32 |
33 import org.tmatesoft.hg.core.SessionContext; | 33 import org.tmatesoft.hg.core.SessionContext; |
34 import org.tmatesoft.hg.repo.HgInternals; | 34 import org.tmatesoft.hg.repo.HgInternals; |
35 import org.tmatesoft.hg.repo.HgInvalidControlFileException; | |
35 import org.tmatesoft.hg.repo.HgRepoConfig.ExtensionsSection; | 36 import org.tmatesoft.hg.repo.HgRepoConfig.ExtensionsSection; |
36 import org.tmatesoft.hg.repo.HgRepository; | 37 import org.tmatesoft.hg.repo.HgRepository; |
37 import org.tmatesoft.hg.util.PathRewrite; | 38 import org.tmatesoft.hg.util.PathRewrite; |
38 | 39 |
39 /** | 40 /** |
78 private final SessionContext sessionContext; | 79 private final SessionContext sessionContext; |
79 private final boolean isCaseSensitiveFileSystem; | 80 private final boolean isCaseSensitiveFileSystem; |
80 private final boolean shallCacheRevlogsInRepo; | 81 private final boolean shallCacheRevlogsInRepo; |
81 | 82 |
82 public Internals(SessionContext ctx) { | 83 public Internals(SessionContext ctx) { |
83 this.sessionContext = ctx; | 84 sessionContext = ctx; |
84 isCaseSensitiveFileSystem = !runningOnWindows(); | 85 isCaseSensitiveFileSystem = !runningOnWindows(); |
85 Object p = ctx.getProperty(CFG_PROPERTY_REVLOG_STREAM_CACHE, true); | 86 Object p = ctx.getProperty(CFG_PROPERTY_REVLOG_STREAM_CACHE, true); |
86 shallCacheRevlogsInRepo = p instanceof Boolean ? ((Boolean) p).booleanValue() : Boolean.parseBoolean(String.valueOf(p)); | 87 shallCacheRevlogsInRepo = p instanceof Boolean ? ((Boolean) p).booleanValue() : Boolean.parseBoolean(String.valueOf(p)); |
87 } | 88 } |
88 | 89 |
89 public void parseRequires(HgRepository hgRepo, File requiresFile) { | 90 public void parseRequires(HgRepository hgRepo, File requiresFile) throws HgInvalidControlFileException { |
90 try { | 91 try { |
91 new RequiresFile().parse(this, requiresFile); | 92 new RequiresFile().parse(this, requiresFile); |
92 } catch (IOException ex) { | 93 } catch (IOException ex) { |
93 // FIXME EXCEPTIONS not quite sure error reading requires file shall be silently logged only. | 94 throw new HgInvalidControlFileException("Parse failed", ex, requiresFile); |
94 HgInternals.getContext(hgRepo).getLog().error(getClass(), ex, null); | |
95 } | 95 } |
96 } | 96 } |
97 | 97 |
98 public/*for tests, otherwise pkg*/ void setStorageConfig(int version, int flags) { | 98 public/*for tests, otherwise pkg*/ void setStorageConfig(int version, int flags) { |
99 requiresFlags = flags; | 99 requiresFlags = flags; |