try {
openConnection();
DAVConnection connection = getConnection();
path = "".equals(path) ? "" : doGetRepositoryPath(path);
DAVFileRevisionHandler davHandler = new DAVFileRevisionHandler(handler);
StringBuffer request = DAVFileRevisionHandler.generateFileRevisionsRequest(null, startRevision,
endRevision, path, includeMergedRevisions);
long revision = -1;
if (isValidRevision(startRevision) && isValidRevision(endRevision)) {
revision = Math.max(startRevision, endRevision);
}
DAVBaselineInfo info = DAVUtil.getBaselineInfo(connection, this, bcPath, revision, false, false, null);
bcPath = SVNPathUtil.append(info.baselineBase, info.baselinePath);
HTTPStatus status = connection.doReport(bcPath, request, davHandler);
if (status.getCode() == 501) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED,
"'get-file-revs' REPORT not implemented");
SVNErrorManager.error(err, status.getError(), SVNLogType.NETWORK);
} else if (status.getError() != null) {
SVNErrorManager.error(status.getError(), SVNLogType.NETWORK);
}
if (davHandler.getEntriesCount() <= 0) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED,
"The file-revs report didn't contain any revisions");
SVNErrorManager.error(err, SVNLogType.NETWORK);
}
return davHandler.getEntriesCount();
} finally {
closeConnection();
}
}