13

我正在尝试使用 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();
}
4

1 回答 1

21

您是否调用了以下静态方法?

DAVRepositoryFactory.setup();

这需要在访问任何http://存储库和类似内容之前调用

SVNRepositoryFactoryImpl.setup();

应该用于svn://存储库。

于 2008-09-25T14:20:34.440 回答