bbi.checkErrors();
}
public void annotateChange(int fileRevIndex, int csetRevIndex, int[] fileParentRevs, int[] fileParentClogRevs) throws HgCallbackTargetException, HgRuntimeException {
HgDataFile targetFile = linesCache.getFile(csetRevIndex);
final LineSequence fileRevLines = linesCache.lines(csetRevIndex, fileRevIndex);
if (fileParentClogRevs[0] != NO_REVISION && fileParentClogRevs[1] != NO_REVISION) {
int p1ClogIndex = fileParentClogRevs[0];
int p2ClogIndex = fileParentClogRevs[1];
LineSequence p1Lines = linesCache.lines(p1ClogIndex, fileParentRevs[0]);
LineSequence p2Lines = linesCache.lines(p2ClogIndex, fileParentRevs[1]);
MergeResolutionStrategy mergeResolver = createMergeStrategy(fileRevLines, p1Lines, p2Lines, csetRevIndex, fileParentClogRevs);
//
DiffHelper<LineSequence> pg = new DiffHelper<LineSequence>();
pg.init(p1Lines, fileRevLines);
BlameBlockInspector bbi = new BlameBlockInspector(targetFile, fileRevIndex, insp, p1ClogIndex, csetRevIndex);
bbi.setMergeParent2(mergeResolver, p2ClogIndex);
pg.findMatchingBlocks(bbi);
bbi.checkErrors();
} else if (fileParentClogRevs[0] == fileParentClogRevs[1]) {
// may be equal iff both are unset
assert fileParentClogRevs[0] == NO_REVISION;
// everything added
BlameBlockInspector bbi = new BlameBlockInspector(targetFile, fileRevIndex, insp, NO_REVISION, csetRevIndex);
bbi.begin(LineSequence.newlines(new byte[0]), fileRevLines);
bbi.match(0, fileRevLines.chunkCount()-1, 0);
bbi.end();
bbi.checkErrors();
} else {
int soleParentIndex = fileParentClogRevs[0] == NO_REVISION ? 1 : 0;
assert fileParentClogRevs[soleParentIndex] != NO_REVISION;
LineSequence parentLines = linesCache.lines(fileParentClogRevs[soleParentIndex], fileParentRevs[soleParentIndex]);
DiffHelper<LineSequence> pg = new DiffHelper<LineSequence>();
pg.init(parentLines, fileRevLines);
BlameBlockInspector bbi = new BlameBlockInspector(targetFile, fileRevIndex, insp, fileParentClogRevs[soleParentIndex], csetRevIndex);
pg.findMatchingBlocks(bbi);