private List<Commit> fetchCommits(final Key project, String url,
String username, String password) {
try {
final List<Commit> ret = new ArrayList<Commit>();
SVNURL svnUrl = SVNURL.parseURIDecoded(url);
SVNClientManager clientManager = SVNClientManager.newInstance(
new DefaultSVNOptions(), username, password);
SVNLogClient logClient = clientManager.getLogClient();
logClient.doLog(svnUrl, new String[] { "." }, SVNRevision.HEAD,
SVNRevision.HEAD, SVNRevision.create(0), true, true, 10,
new ISVNLogEntryHandler() {
@Override
public void handleLogEntry(SVNLogEntry logEntry)
throws SVNException {
ret.add(new Commit(project, logEntry));
}
});
clientManager.dispose();
return ret;
} catch (SVNException e) {
log.error("Unable to refresh data from svn: {} {}", e.getClass()
.getSimpleName(), e.getMessage());
}