Mercurial > hg4j
comparison src/org/tmatesoft/hg/repo/HgRepository.java @ 425:48f993aa2f41
FIXMEs: exceptions, javadoc
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 28 Mar 2012 18:39:29 +0200 |
parents | 9c9c442b5f2e |
children | d280759c2a3f |
comparison
equal
deleted
inserted
replaced
424:6437d261048a | 425:48f993aa2f41 |
---|---|
23 import java.util.ArrayList; | 23 import java.util.ArrayList; |
24 import java.util.Collections; | 24 import java.util.Collections; |
25 import java.util.HashMap; | 25 import java.util.HashMap; |
26 import java.util.List; | 26 import java.util.List; |
27 | 27 |
28 import org.tmatesoft.hg.core.HgException; | |
29 import org.tmatesoft.hg.core.Nodeid; | 28 import org.tmatesoft.hg.core.Nodeid; |
30 import org.tmatesoft.hg.core.SessionContext; | 29 import org.tmatesoft.hg.core.SessionContext; |
31 import org.tmatesoft.hg.internal.ByteArrayChannel; | 30 import org.tmatesoft.hg.internal.ByteArrayChannel; |
32 import org.tmatesoft.hg.internal.ConfigFile; | 31 import org.tmatesoft.hg.internal.ConfigFile; |
33 import org.tmatesoft.hg.internal.DataAccessProvider; | 32 import org.tmatesoft.hg.internal.DataAccessProvider; |
126 normalizePath = null; | 125 normalizePath = null; |
127 sessionContext = null; | 126 sessionContext = null; |
128 impl = null; | 127 impl = null; |
129 } | 128 } |
130 | 129 |
131 HgRepository(SessionContext ctx, String repositoryPath, File repositoryRoot) { | 130 /** |
131 * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em> | |
132 */ | |
133 HgRepository(SessionContext ctx, String repositoryPath, File repositoryRoot) throws HgRuntimeException { | |
132 assert ".hg".equals(repositoryRoot.getName()) && repositoryRoot.isDirectory(); | 134 assert ".hg".equals(repositoryRoot.getName()) && repositoryRoot.isDirectory(); |
133 assert repositoryPath != null; | 135 assert repositoryPath != null; |
134 assert repositoryRoot != null; | 136 assert repositoryRoot != null; |
135 assert ctx != null; | 137 assert ctx != null; |
136 repoDir = repositoryRoot; | 138 repoDir = repositoryRoot; |
191 final String content = new String(sink.toArray(), "UTF8"); | 193 final String content = new String(sink.toArray(), "UTF8"); |
192 tags.readGlobal(new StringReader(content)); | 194 tags.readGlobal(new StringReader(content)); |
193 } catch (CancelledException ex) { | 195 } catch (CancelledException ex) { |
194 // IGNORE, can't happen, we did not configure cancellation | 196 // IGNORE, can't happen, we did not configure cancellation |
195 getContext().getLog().debug(getClass(), ex, null); | 197 getContext().getLog().debug(getClass(), ex, null); |
196 } catch (HgException ex) { | |
197 getContext().getLog().error(getClass(), ex, null); | |
198 // FIXME EXCEPTIONS need to react | |
199 } catch (IOException ex) { | 198 } catch (IOException ex) { |
200 // UnsupportedEncodingException can't happen (UTF8) | 199 // UnsupportedEncodingException can't happen (UTF8) |
201 // only from readGlobal. Need to reconsider exceptions thrown from there: | 200 // only from readGlobal. Need to reconsider exceptions thrown from there: |
202 // BufferedReader wraps String and unlikely to throw IOException, perhaps, log is enough? | 201 // BufferedReader wraps String and unlikely to throw IOException, perhaps, log is enough? |
203 getContext().getLog().error(getClass(), ex, null); | 202 getContext().getLog().error(getClass(), ex, null); |