SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR,
"Too many arguments given");
SVNErrorManager.error(err, SVNLogType.CLIENT);
}
SVNPath source = new SVNPath((String) targets.get(0), true);
SVNRevision srcPegRevision = source.getPegRevision();
if (srcPegRevision == SVNRevision.UNDEFINED) {
srcPegRevision = SVNRevision.HEAD;
}
SVNPath target = null;
SVNRevision tgtPegRevision = null;
if (targets.size() == 2) {
target = new SVNPath((String) targets.get(1), true);
tgtPegRevision = target.getPegRevision();
} else {
target = new SVNPath("");
tgtPegRevision = SVNRevision.UNDEFINED;
}
if (tgtPegRevision == SVNRevision.UNDEFINED) {
if (target.isURL()) {
tgtPegRevision = SVNRevision.HEAD;
} else {
tgtPegRevision = SVNRevision.BASE;
}
}
SVNDiffClient client = getSVNEnvironment().getClientManager().getDiffClient();
if (getSVNEnvironment().getShowRevisionType() == SVNShowRevisionType.MERGED) {
if (target.isURL()) {
if (source.isURL()) {
client.doGetLogMergedMergeInfo(target.getURL(), tgtPegRevision, source.getURL(), srcPegRevision,
false, null, this);
} else {
client.doGetLogMergedMergeInfo(target.getURL(), tgtPegRevision, source.getFile(), srcPegRevision,
false, null, this);
}
} else {
if (source.isURL()) {
client.doGetLogMergedMergeInfo(target.getFile(), tgtPegRevision, source.getURL(), srcPegRevision,
false, null, this);
} else {
client.doGetLogMergedMergeInfo(target.getFile(), tgtPegRevision, source.getFile(), srcPegRevision,
false, null, this);
}
}
} else if (getSVNEnvironment().getShowRevisionType() == SVNShowRevisionType.ELIGIBLE) {
if (target.isURL()) {
if (source.isURL()) {
client.doGetLogEligibleMergeInfo(target.getURL(), tgtPegRevision, source.getURL(), srcPegRevision,
false, null, this);
} else {
client.doGetLogEligibleMergeInfo(target.getURL(), tgtPegRevision, source.getFile(), srcPegRevision,
false, null, this);
}
} else {
if (source.isURL()) {
client.doGetLogEligibleMergeInfo(target.getFile(), tgtPegRevision, source.getURL(), srcPegRevision,
false, null, this);
} else {
client.doGetLogEligibleMergeInfo(target.getFile(), tgtPegRevision, source.getFile(), srcPegRevision,
false, null, this);
}
}
}
}