Mercurial > jhg
comparison src/org/tmatesoft/hg/internal/RevlogStream.java @ 367:2fadf8695f8a
Use 'revision index' instead of the vague 'local revision number' concept in the API
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 16 Dec 2011 15:37:27 +0100 |
parents | 189dc6dc1c3e |
children | 729ba8f7d14e |
comparison
equal
deleted
inserted
replaced
366:189dc6dc1c3e | 367:2fadf8695f8a |
---|---|
151 // Unlike its counterpart, {@link Revlog#getLocalRevisionNumber()}, doesn't fail with exception if node not found, | 151 // Unlike its counterpart, {@link Revlog#getLocalRevisionNumber()}, doesn't fail with exception if node not found, |
152 /** | 152 /** |
153 * @return integer in [0..revisionCount()) or {@link HgRepository#BAD_REVISION} if not found | 153 * @return integer in [0..revisionCount()) or {@link HgRepository#BAD_REVISION} if not found |
154 * @throws HgInvalidControlFileException if attempt to read index file failed | 154 * @throws HgInvalidControlFileException if attempt to read index file failed |
155 */ | 155 */ |
156 public int findLocalRevisionNumber(Nodeid nodeid) throws HgInvalidControlFileException { | 156 public int findRevisionIndex(Nodeid nodeid) throws HgInvalidControlFileException { |
157 // XXX this one may be implemented with iterate() once there's mechanism to stop iterations | 157 // XXX this one may be implemented with iterate() once there's mechanism to stop iterations |
158 final int indexSize = revisionCount(); | 158 final int indexSize = revisionCount(); |
159 DataAccess daIndex = getIndexStream(); | 159 DataAccess daIndex = getIndexStream(); |
160 try { | 160 try { |
161 byte[] nodeidBuf = new byte[20]; | 161 byte[] nodeidBuf = new byte[20]; |
526 | 526 |
527 public interface Inspector { | 527 public interface Inspector { |
528 // XXX boolean retVal to indicate whether to continue? | 528 // XXX boolean retVal to indicate whether to continue? |
529 // TODO specify nodeid and data length, and reuse policy (i.e. if revlog stream doesn't reuse nodeid[] for each call) | 529 // TODO specify nodeid and data length, and reuse policy (i.e. if revlog stream doesn't reuse nodeid[] for each call) |
530 // implementers shall not invoke DataAccess.done(), it's accomplished by #iterate at appropraite moment | 530 // implementers shall not invoke DataAccess.done(), it's accomplished by #iterate at appropraite moment |
531 void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[/*20*/] nodeid, DataAccess data) throws HgException; | 531 void next(int revisionIndex, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[/*20*/] nodeid, DataAccess data) throws HgException; |
532 } | 532 } |
533 } | 533 } |