final ISVNLogEntryHandler handler) throws SVNException {
if (targetPaths == null || targetPaths.length == 0) {
targetPaths = new String[]{""};
}
DAVLogHandler davHandler = null;
ISVNLogEntryHandler cachingHandler = new ISVNLogEntryHandler() {
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
if (logEntry.getDate() != null) {
getOptions().saveCommitMessage(DAVRepository.this, logEntry.getRevision(), logEntry.getMessage());
}
if (handler != null) {
handler.handleLogEntry(logEntry);
}
}
};
long latestRev = -1;
if (isInvalidRevision(startRevision)) {
startRevision = latestRev = getLatestRevision();
}
if (isInvalidRevision(endRevision)) {
endRevision = latestRev != -1 ? latestRev : getLatestRevision();
}
try {
openConnection();
DAVConnection connection = getConnection();
String[] fullPaths = new String[targetPaths.length];
for (int i = 0; i < targetPaths.length; i++) {
fullPaths[i] = doGetFullPath(targetPaths[i]);
}
Collection relativePaths = new SVNHashSet();
String path = SVNPathUtil.condencePaths(fullPaths, relativePaths, false);
if (relativePaths.isEmpty()) {
relativePaths.add("");
}
fullPaths = (String[]) relativePaths.toArray(new String[relativePaths.size()]);
StringBuffer request = DAVLogHandler.generateLogRequest(null, startRevision, endRevision, changedPath,
strictNode, includeMergedRevisions, revPropNames, limit, fullPaths);
davHandler = new DAVLogHandler(cachingHandler, limit, revPropNames);
if (davHandler.isWantCustomRevprops()) {
String capability = connection.getCapabilityResponse(SVNCapability.LOG_REVPROPS);
if (!DAVConnection.DAV_CAPABILITY_SERVER_YES.equals(capability) &&
!DAVConnection.DAV_CAPABILITY_YES.equals(capability)) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED,
"Server does not support custom revprops via log");
SVNErrorManager.error(err, SVNLogType.NETWORK);
}
}
long revision = Math.max(startRevision, endRevision);
path = SVNEncodingUtil.uriEncode(path);
DAVBaselineInfo info = DAVUtil.getBaselineInfo(connection, this, path, revision, false, false, null);
path = SVNPathUtil.append(info.baselineBase, info.baselinePath);
try {
HTTPStatus status = connection.doReport(path, request, davHandler);
if (status.getError() != null) {
SVNErrorManager.error(status.getError(), SVNLogType.NETWORK);
}
} catch (SVNException e) {
if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.UNKNOWN &&
davHandler.isCompatibleMode()) {
cachingHandler.handleLogEntry(SVNLogEntry.EMPTY_ENTRY);
} else {
throw e;
}
}