void walk(int[] manifestRevIndexes, RevlogStream content) throws HgRuntimeException {
content.iterate(manifestRevIndexes, true, this);
}
public void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[] nodeid, DataAccess data) throws HgRuntimeException {
ByteVector byteVector = new ByteVector(256, 128); // allocate for long paths right away
try {
byte b;
while (!data.isEmpty() && (b = data.readByte()) != '\n') {
if (b != 0) {
byteVector.add(b);
} else {
if (byteVector.equalsTo(filenameAsBytes)) {
Nodeid fileRev = null;
Flags flags = null;
if (csetIndex2FileRev != null || delegate != null) {
byte[] nid = new byte[40];
data.readBytes(nid, 0, 40);
fileRev = Nodeid.fromAscii(nid, 0, 40);
} else {
data.skip(40);
}
if (csetIndex2Flags != null || delegate != null) {
byteVector.clear();
while (!data.isEmpty() && (b = data.readByte()) != '\n') {
byteVector.add(b);
}
if (byteVector.size() == 0) {
flags = Flags.RegularFile;
} else {
flags = Flags.parse(byteVector.toByteArray(), 0, byteVector.size());
}
}
if (delegate != null) {
assert flags != null;
assert fileRev != null;
delegate.begin(revisionNumber, Nodeid.fromBinary(nodeid, 0), linkRevision);
delegate.next(fileRev, filename, flags);
delegate.end(revisionNumber);
} else {
if (csetIndex2FileRev != null) {
csetIndex2FileRev.put(linkRevision, fileRev);
}
if (csetIndex2Flags != null) {
csetIndex2Flags.put(linkRevision, flags);
}
}
break;
} else {
data.skip(40);
}
// else skip to the end of line
while (!data.isEmpty() && (b = data.readByte()) != '\n')
;
byteVector.clear();
}
}
} catch (IOException ex) {
throw new HgInvalidControlFileException("Failed reading manifest", ex, null);
}