}
if (targets.isEmpty()) {
targets.add("");
}
SVNDiffClient client = getSVNEnvironment().getClientManager().getDiffClient();
DefaultSVNDiffGenerator diffGenerator = new DefaultSVNDiffGenerator();
if (getSVNEnvironment().getDiffCommand() != null) {
diffGenerator.setExternalDiffCommand(getSVNEnvironment().getDiffCommand());
diffGenerator.setRawDiffOptions(getSVNEnvironment().getExtensions());
} else {
diffGenerator.setDiffOptions(getSVNEnvironment().getDiffOptions());
}
diffGenerator.setDiffDeleted(!getSVNEnvironment().isNoDiffDeleted());
diffGenerator.setForcedBinaryDiff(getSVNEnvironment().isForce());
diffGenerator.setBasePath(new File("").getAbsoluteFile());
diffGenerator.setFallbackToAbsolutePath(true);
diffGenerator.setOptions(client.getOptions());
client.setDiffGenerator(diffGenerator);
PrintStream ps = getSVNEnvironment().getOut();
Collection changeLists = getSVNEnvironment().getChangelistsCollection();
for(int i = 0; i < targets.size(); i++) {
String targetName = (String) targets.get(i);
if (!peggedDiff) {
SVNPath target1 = new SVNPath(SVNPathUtil.append(oldTarget.getTarget(), targetName));
SVNPath target2 = new SVNPath(SVNPathUtil.append(newTarget.getTarget(), targetName));
if (getSVNEnvironment().isSummarize()) {
if (target1.isURL() && target2.isURL()) {
client.doDiffStatus(target1.getURL(), start, target2.getURL(), end, getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), this);
} else if (target1.isURL()) {
client.doDiffStatus(target1.getURL(), start, target2.getFile(), end, getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), this);
} else if (target2.isURL()) {
client.doDiffStatus(target1.getFile(), start, target2.getURL(), end, getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), this);
} else {
client.doDiffStatus(target1.getFile(), start, target2.getFile(), end, getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), this);
}
} else {
if (target1.isURL() && target2.isURL()) {
client.doDiff(target1.getURL(), start, target2.getURL(), end,
getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), ps);
} else if (target1.isURL()) {
client.doDiff(target1.getURL(), start, target2.getFile(), end,
getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), ps,
changeLists);
} else if (target2.isURL()) {
client.doDiff(target1.getFile(), start, target2.getURL(), end,
getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), ps,
changeLists);
} else {
client.doDiff(target1.getFile(), start, target2.getFile(), end,
getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), ps,
changeLists);
}
}
} else {
SVNPath target = new SVNPath(targetName, true);
SVNRevision pegRevision = target.getPegRevision();
if (pegRevision == SVNRevision.UNDEFINED) {
pegRevision = target.isURL() ? SVNRevision.HEAD : SVNRevision.WORKING;
}
if (getSVNEnvironment().isSummarize()) {
if (target.isURL()) {
client.doDiffStatus(target.getURL(), start, end, pegRevision, getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), this);
} else {
client.doDiffStatus(target.getFile(), start, end, pegRevision, getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), this);
}
} else {
if (target.isURL()) {
client.doDiff(target.getURL(), pegRevision, start, end, getSVNEnvironment().getDepth(),
getSVNEnvironment().isNoticeAncestry(), ps);
} else {
client.doDiff(target.getFile(), pegRevision, start, end, getSVNEnvironment().getDepth(),
getSVNEnvironment().isNoticeAncestry(), ps, changeLists);
}
}
}
}