comparison src/org/tmatesoft/hg/repo/Revlog.java @ 416:d30083c80d52

Better names - non-confusing and aligned with the rest of API
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 22 Mar 2012 19:11:33 +0100
parents 866fc3b597a0
children 528b6780a8bd
comparison
equal deleted inserted replaced
415:ee8264d80747 416:d30083c80d52
194 } 194 }
195 195
196 /** 196 /**
197 * Access to revision data as is (decompressed, but otherwise unprocessed, i.e. not parsed for e.g. changeset or manifest entries). 197 * Access to revision data as is (decompressed, but otherwise unprocessed, i.e. not parsed for e.g. changeset or manifest entries).
198 * 198 *
199 * @param fileRevisionIndex index of this revlog change (not a changelog revision index), non-negative. From predefined constants, only {@link HgRepository#TIP} makes sense. 199 * @param revisionIndex index of this revlog change (not a changelog revision index), non-negative. From predefined constants, only {@link HgRepository#TIP} makes sense.
200 * @param sink data destination 200 * @param sink data destination
201 * 201 *
202 * @throws HgInvalidRevisionException if supplied argument doesn't represent revision index in this revlog 202 * @throws HgInvalidRevisionException if supplied argument doesn't represent revision index in this revlog
203 * @throws HgInvalidControlFileException if access to revlog index/data entry failed 203 * @throws HgInvalidControlFileException if access to revlog index/data entry failed
204 * @throws CancelledException if content retrieval operation was cancelled 204 * @throws CancelledException if content retrieval operation was cancelled
205 */ 205 */
206 protected void rawContent(int fileRevisionIndex, ByteChannel sink) throws HgInvalidControlFileException, CancelledException, HgInvalidRevisionException { 206 protected void rawContent(int revisionIndex, ByteChannel sink) throws HgInvalidControlFileException, CancelledException, HgInvalidRevisionException {
207 if (sink == null) { 207 if (sink == null) {
208 throw new IllegalArgumentException(); 208 throw new IllegalArgumentException();
209 } 209 }
210 try { 210 try {
211 ContentPipe insp = new ContentPipe(sink, 0, repo.getContext().getLog()); 211 ContentPipe insp = new ContentPipe(sink, 0, repo.getContext().getLog());
212 insp.checkCancelled(); 212 insp.checkCancelled();
213 content.iterate(fileRevisionIndex, fileRevisionIndex, true, insp); 213 content.iterate(revisionIndex, revisionIndex, true, insp);
214 insp.checkFailed(); 214 insp.checkFailed();
215 } catch (IOException ex) { 215 } catch (IOException ex) {
216 HgInvalidControlFileException e = new HgInvalidControlFileException(String.format("Access to revision %d content failed", fileRevisionIndex), ex, null); 216 HgInvalidControlFileException e = new HgInvalidControlFileException(String.format("Access to revision %d content failed", revisionIndex), ex, null);
217 e.setRevisionIndex(fileRevisionIndex); 217 e.setRevisionIndex(revisionIndex);
218 // FIXME e.setFileName(content.getIndexFile() or this.getHumanFriendlyPath()) - shall decide whether 218 // FIXME e.setFileName(content.getIndexFile() or this.getHumanFriendlyPath()) - shall decide whether
219 // protected abstract getPath() with impl in HgDataFile, HgManifest and HgChangelog or path is data of either Revlog or RevlogStream 219 // protected abstract getPath() with impl in HgDataFile, HgManifest and HgChangelog or path is data of either Revlog or RevlogStream
220 // Do the same (add file name) below 220 // Do the same (add file name) below
221 throw e; 221 throw e;
222 } catch (HgInvalidControlFileException ex) { 222 } catch (HgInvalidControlFileException ex) {
223 throw ex; 223 throw ex;
224 } catch (HgException ex) { 224 } catch (HgException ex) {
225 HgInvalidControlFileException e = new HgInvalidControlFileException(ex.getClass().getSimpleName(), ex, null); 225 HgInvalidControlFileException e = new HgInvalidControlFileException(ex.getClass().getSimpleName(), ex, null);
226 e.setRevisionIndex(fileRevisionIndex); 226 e.setRevisionIndex(revisionIndex);
227 throw e; 227 throw e;
228 } 228 }
229 } 229 }
230 230
231 /** 231 /**