您的位置:首页 > 其它

SVNKit

2017-11-09 16:19 316 查看


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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  SVNKit