SVNURL repositoryURL = SVNURL.parseURIEncoded("https://127.0.0.1/svn/graph/face");
DefaultSVNOptions myOptions = SVNWCUtil.createDefaultOptions(false);
SVNClientManager clientManager = SVNClientManager.newInstance(myOptions, "user", "passwd");
/* 1、打印提交日志 */
clientManager.getLogClient().doLog(repositoryURL.appendPath("index.html", false), null, null, null, null, true,
false, 0, new ISVNLogEntryHandler() {
@Override
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
System.out.println(logEntry.getRevision() + ":" + logEntry.getMessage());
}
});
/* 2、打印版本差异 */
ByteArrayOutputStream baos = new ByteArrayOutputStream();
clientManager.getDiffClient().doDiff(repositoryURL.appendPath("index.html", false), null,
SVNRevision.create(64), SVNRevision.create(63), SVNDepth.EMPTY, false, baos);
System.out.println(baos.toString());
/* 3、检出工程到本地 */
clientManager.getUpdateClient().doCheckout(repositoryURL, new File("C:\\Temp\\face"), SVNRevision.HEAD,
SVNRevision.HEAD, SVNDepth.INFINITY, true);