HgDataFile fileNode = qe.file();
// TODO int fileLastRevIndexToVisit = qe.fileTo
int fileLastRevIndexToVisit = followAncestry ? fileNode.getRevisionIndex(qe.lastFileRev()) : fileNode.getLastRevision();
completeHistory = new HistoryNode[fileLastRevIndexToVisit+1];
commitRevisions = new int[completeHistory.length];
fileNode.indexWalk(qe.fileFrom(), fileLastRevIndexToVisit, this);
if (!followAncestry) {
resultHistory = new ArrayList<HistoryNode>(fileLastRevIndexToVisit - qe.fileFrom() + 1);
// items in completeHistory with index < qe.fileFrom are empty
for (int i = qe.fileFrom(); i <= fileLastRevIndexToVisit; i++) {
resultHistory.add(completeHistory[i]);