Mercurial > jhg
comparison src/org/tmatesoft/hg/internal/RevlogStream.java @ 538:dd4f6311af52
Commit: first working version
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 05 Feb 2013 22:30:21 +0100 |
parents | 243202f1bda5 |
children | 9edfd5a223b8 |
comparison
equal
deleted
inserted
replaced
537:5a455624be4f | 538:dd4f6311af52 |
---|---|
221 } finally { | 221 } finally { |
222 daIndex.done(); | 222 daIndex.done(); |
223 } | 223 } |
224 return BAD_REVISION; | 224 return BAD_REVISION; |
225 } | 225 } |
226 | |
227 public long newEntryOffset() { | |
228 if (revisionCount() == 0) { | |
229 return 0; | |
230 } | |
231 DataAccess daIndex = getIndexStream(); | |
232 int lastRev = revisionCount() - 1; | |
233 try { | |
234 int recordOffset = getIndexOffsetInt(lastRev); | |
235 daIndex.seek(recordOffset); | |
236 long value = daIndex.readLong(); | |
237 value = value >>> 16; | |
238 int compressedLen = daIndex.readInt(); | |
239 return lastRev == 0 ? compressedLen : value + compressedLen; | |
240 } catch (IOException ex) { | |
241 throw new HgInvalidControlFileException("Linked revision lookup failed", ex, indexFile).setRevisionIndex(lastRev); | |
242 } finally { | |
243 daIndex.done(); | |
244 } | |
245 } | |
246 | |
226 | 247 |
227 | 248 |
228 // should be possible to use TIP, ALL, or -1, -2, -n notation of Hg | 249 // should be possible to use TIP, ALL, or -1, -2, -n notation of Hg |
229 // ? boolean needsNodeid | 250 // ? boolean needsNodeid |
230 public void iterate(int start, int end, boolean needData, Inspector inspector) throws HgInvalidRevisionException, HgInvalidControlFileException { | 251 public void iterate(int start, int end, boolean needData, Inspector inspector) throws HgInvalidRevisionException, HgInvalidControlFileException { |