boolean discoverChangedPaths, boolean includeMergedRevisions, long limit, String[] revisionProperties,
final ISVNLogEntryHandler handler) throws SVNException {
SVNRevision sessionRevision = SVNRevision.UNDEFINED;
List editedRevisionRanges = new LinkedList();
for (Iterator revRangesIter = revisionRanges.iterator(); revRangesIter.hasNext();) {
SVNRevisionRange revRange = (SVNRevisionRange) revRangesIter.next();
if (revRange.getStartRevision().isValid() && !revRange.getEndRevision().isValid()) {
revRange = new SVNRevisionRange(revRange.getStartRevision(), revRange.getStartRevision());
} else if (!revRange.getStartRevision().isValid()) {
SVNRevision start = SVNRevision.UNDEFINED;
SVNRevision end = SVNRevision.UNDEFINED;
if (!pegRevision.isValid()) {
start = SVNRevision.HEAD;
} else {
start = pegRevision;
}
if (!revRange.getEndRevision().isValid()) {
end = SVNRevision.create(0);
}
revRange = new SVNRevisionRange(start, end);
}
if (!revRange.getStartRevision().isValid() || !revRange.getEndRevision().isValid()) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_BAD_REVISION, "Missing required revision specification");
SVNErrorManager.error(err, SVNLogType.WC);
}
if (needsWC(revRange.getStartRevision()) || needsWC(revRange.getEndRevision())) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_BAD_REVISION,
"Revision type requires a working copy path, not a URL");
SVNErrorManager.error(err, SVNLogType.WC);
}
editedRevisionRanges.add(revRange);
if (!sessionRevision.isValid()) {
SVNRevision start = revRange.getStartRevision();
SVNRevision end = revRange.getEndRevision();
if (SVNRevision.isValidRevisionNumber(start.getNumber()) && SVNRevision.isValidRevisionNumber(end.getNumber())) {
sessionRevision = start.getNumber() > end.getNumber() ? start : end;
} else if (start.getDate() != null && end.getDate() != null) {
sessionRevision = start.getDate().compareTo(end.getDate()) > 0 ? start : end;
}
}
}
if (needsWC(pegRevision)) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_BAD_REVISION,
"Revision type requires a working copy path, not a URL");
SVNErrorManager.error(err, SVNLogType.WC);
}
if (limit > Integer.MAX_VALUE) {
limit = Integer.MAX_VALUE;
}
paths = paths == null || paths.length == 0 ? new String[] {""} : paths;
ISVNLogEntryHandler wrappingHandler = new ISVNLogEntryHandler() {
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
checkCancelled();
handler.handleLogEntry(logEntry);
}
};
SVNRepository repos = sessionRevision.isValid() ? createRepository(url, null, null, pegRevision, sessionRevision, null) :
createRepository(url, null, null, true);
for (Iterator revRangesIter = editedRevisionRanges.iterator(); revRangesIter.hasNext();) {
checkCancelled();
SVNRevisionRange revRange = (SVNRevisionRange) revRangesIter.next();
long startRev = getRevisionNumber(revRange.getStartRevision(), repos, null);
long endRev = getRevisionNumber(revRange.getEndRevision(), repos, null);
repos.log(paths, startRev, endRev, discoverChangedPaths, stopOnCopy, limit, includeMergedRevisions, revisionProperties,
wrappingHandler);
}
}