Mercurial > jhg
comparison src/org/tmatesoft/hg/internal/RevlogDump.java @ 168:dd525ca65de8
Stupid defect that cost me couple of hours. What a coincidence for merge revision of interest (157) to be right on the BIS buffer boundary.
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Tue, 22 Mar 2011 21:18:40 +0100 |
| parents | d5268ca7715b |
| children | e9d275fb0bc0 |
comparison
equal
deleted
inserted
replaced
| 167:86f9581f4301 | 168:dd525ca65de8 |
|---|---|
| 71 int linkRevision = di.readInt(); | 71 int linkRevision = di.readInt(); |
| 72 int parent1Revision = di.readInt(); | 72 int parent1Revision = di.readInt(); |
| 73 int parent2Revision = di.readInt(); | 73 int parent2Revision = di.readInt(); |
| 74 byte[] buf = new byte[32]; | 74 byte[] buf = new byte[32]; |
| 75 di.readFully(buf, 12, 20); | 75 di.readFully(buf, 12, 20); |
| 76 dis.skip(12); | 76 dis.skipBytes(12); |
| 77 // CAN'T USE skip() here without extra precautions. E.g. I ran into situation when | |
| 78 // buffer was 8192 and BufferedInputStream was at position 8182 before attempt to skip(12). | |
| 79 // BIS silently skips available bytes and leaves me two extra bytes that ruin the rest of the code. | |
| 77 System.out.printf("%4d:%14d %6X %10d %10d %10d %10d %8d %8d %040x\n", entryCount, offset, flags, compressedLen, actualLen, baseRevision, linkRevision, parent1Revision, parent2Revision, new BigInteger(buf)); | 80 System.out.printf("%4d:%14d %6X %10d %10d %10d %10d %8d %8d %040x\n", entryCount, offset, flags, compressedLen, actualLen, baseRevision, linkRevision, parent1Revision, parent2Revision, new BigInteger(buf)); |
| 78 if (inlineData) { | 81 if (inlineData) { |
| 79 String resultString; | 82 String resultString; |
| 80 byte[] data = new byte[compressedLen]; | 83 byte[] data = new byte[compressedLen]; |
| 81 di.readFully(data); | 84 di.readFully(data); |
