我正在尝试使用 SVNkit 在两个 svn url 上运行差异。问题是我在diff.doDiff
被调用时收到错误。
org.tmatesoft.svn.core.SVNException: svn: Unable to create SVNRepository object for ' http://svn.codehaus.org/jruby/trunk/jruby/src/org/jruby/Finalizable.java' 在 org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:40) 在 org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:55) 在 org. tmatesoft.svn.core.io.SVNRepositoryFactory.create(SVNRepositoryFactory.java:199) 在 org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool.createRepository(DefaultSVNRepositoryPool.java:213) 在 org.tmatesoft.svn.core.wc。 SVNClientManager.createRepository(SVNClientManager.java:242) 在 org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:231) 在 org.tmatesoft.svn.core.wc.SVNDiffClient.doDiffURL(SVNDiffClient.java:第769章)
我已经仔细检查了 URL(我可以在 TortoiseSVN 客户端中打开它们)。有人可以帮我知道发生了什么吗?我已经发布了我在下面运行的代码。
SVNClientManager manager = SVNClientManager.newInstance(SVNWCUtil.createDefaultOptions(false), user, pass);
SVNDiffClient diff = manager.getDiffClient();
//ISVNDiffStatusHandler diffStatus = new ISVNDiffStatusHandler();
try {
SVNURL oldURL = SVNURL.parseURIDecoded(url);
diff.doDiff(SVNURL.parseURIDecoded(url), SVNRevision.create(oldVersion), SVNURL.parseURIDecoded(url), SVNRevision.HEAD, false, false, System.out);
} catch (SVNException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}