Mercurial > hg4j
comparison src/org/tmatesoft/hg/internal/RevlogStream.java @ 440:299870249a28
Issue 30: bogus IOException for mmap file on linux
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 19 Apr 2012 19:18:25 +0200 |
parents | 48f993aa2f41 |
children | 1ee452f31187 |
comparison
equal
deleted
inserted
replaced
439:2bf6f917a7e5 | 440:299870249a28 |
---|---|
117 int recordOffset = getIndexOffsetInt(revisionIndex); | 117 int recordOffset = getIndexOffsetInt(revisionIndex); |
118 daIndex.seek(recordOffset + 12); // 6+2+4 | 118 daIndex.seek(recordOffset + 12); // 6+2+4 |
119 int actualLen = daIndex.readInt(); | 119 int actualLen = daIndex.readInt(); |
120 return actualLen; | 120 return actualLen; |
121 } catch (IOException ex) { | 121 } catch (IOException ex) { |
122 throw new HgInvalidControlFileException(null, ex, indexFile); | 122 throw new HgInvalidControlFileException(null, ex, indexFile).setRevisionIndex(revisionIndex); |
123 } finally { | 123 } finally { |
124 daIndex.done(); | 124 daIndex.done(); |
125 } | 125 } |
126 } | 126 } |
127 | 127 |
139 daIndex.seek(recordOffset + 32); | 139 daIndex.seek(recordOffset + 32); |
140 byte[] rv = new byte[20]; | 140 byte[] rv = new byte[20]; |
141 daIndex.readBytes(rv, 0, 20); | 141 daIndex.readBytes(rv, 0, 20); |
142 return rv; | 142 return rv; |
143 } catch (IOException ex) { | 143 } catch (IOException ex) { |
144 throw new HgInvalidControlFileException(null, ex, indexFile); | 144 throw new HgInvalidControlFileException("Revision lookup failed", ex, indexFile).setRevisionIndex(revisionIndex); |
145 } finally { | 145 } finally { |
146 daIndex.done(); | 146 daIndex.done(); |
147 } | 147 } |
148 } | 148 } |
149 | 149 |
160 int recordOffset = getIndexOffsetInt(revisionIndex); | 160 int recordOffset = getIndexOffsetInt(revisionIndex); |
161 daIndex.seek(recordOffset + 20); | 161 daIndex.seek(recordOffset + 20); |
162 int linkRev = daIndex.readInt(); | 162 int linkRev = daIndex.readInt(); |
163 return linkRev; | 163 return linkRev; |
164 } catch (IOException ex) { | 164 } catch (IOException ex) { |
165 throw new HgInvalidControlFileException(null, ex, indexFile); | 165 throw new HgInvalidControlFileException("Linked revision lookup failed", ex, indexFile).setRevisionIndex(revisionIndex); |
166 } finally { | 166 } finally { |
167 daIndex.done(); | 167 daIndex.done(); |
168 } | 168 } |
169 } | 169 } |
170 | 170 |
191 return i; | 191 return i; |
192 } | 192 } |
193 daIndex.skip(inline ? 12 + compressedLen : 12); | 193 daIndex.skip(inline ? 12 + compressedLen : 12); |
194 } | 194 } |
195 } catch (IOException ex) { | 195 } catch (IOException ex) { |
196 throw new HgInvalidControlFileException("Failed", ex, indexFile).setRevision(nodeid); | 196 throw new HgInvalidControlFileException("Revision lookup failed", ex, indexFile).setRevision(nodeid); |
197 } finally { | 197 } finally { |
198 daIndex.done(); | 198 daIndex.done(); |
199 } | 199 } |
200 return BAD_REVISION; | 200 return BAD_REVISION; |
201 } | 201 } |