LinkedList oldPathRevisions = mainLinePathRevisions;
LinkedList newPathRevisions = null;
do {
newPathRevisions = new LinkedList();
for (Iterator oldPathRevsIter = oldPathRevisions.iterator(); oldPathRevsIter.hasNext();) {
SVNLocationEntry oldPathRevision = (SVNLocationEntry) oldPathRevsIter.next();
Map mergedMergeInfo = oldPathRevision.getMergedMergeInfo();
if (mergedMergeInfo == null) {
continue;
}
for (Iterator mergeInfoIter = mergedMergeInfo.keySet().iterator(); mergeInfoIter.hasNext();) {
String path = (String) mergeInfoIter.next();
SVNMergeRangeList rangeList = (SVNMergeRangeList) mergedMergeInfo.get(path);
SVNMergeRange[] ranges = rangeList.getRanges();
for (int j = 0; j < ranges.length; j++) {
SVNMergeRange range = ranges[j];
FSRevisionRoot root = myFSFS.createRevisionRoot(range.getEndRevision());
SVNNodeKind kind = root.checkNodeKind(path);
if (kind != SVNNodeKind.FILE) {
continue;
}
newPathRevisions = findInterestingRevisions(newPathRevisions, path,
range.getStartRevision(), range.getEndRevision(), true, true, duplicatePathRevs);
}
}
}
mergedPathRevisions.addAll(newPathRevisions);
oldPathRevisions = newPathRevisions;
} while (!newPathRevisions.isEmpty());
Collections.sort(mergedPathRevisions, new Comparator() {
public int compare(Object arg0, Object arg1) {
SVNLocationEntry pathRevision1 = (SVNLocationEntry) arg0;
SVNLocationEntry pathRevision2 = (SVNLocationEntry) arg1;
if (pathRevision1.getRevision() == pathRevision2.getRevision()) {
return 0;
}
return pathRevision1.getRevision() < pathRevision2.getRevision() ? 1 : -1;
}
});
return mergedPathRevisions;
}