13

I am trying to run a diff on two svn urls using SVNkit. The problem is that I get the error when diff.doDiff is called.

org.tmatesoft.svn.core.SVNException: svn: Unable to create SVNRepository object for 'http://svn.codehaus.org/jruby/trunk/jruby/src/org/jruby/Finalizable.java' at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:55) at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:40) at org.tmatesoft.svn.core.io.SVNRepositoryFactory.create(SVNRepositoryFactory.java:199) at org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool.createRepository(DefaultSVNRepositoryPool.java:213) at org.tmatesoft.svn.core.wc.SVNClientManager.createRepository(SVNClientManager.java:242) at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:231) at org.tmatesoft.svn.core.wc.SVNDiffClient.doDiffURLURL(SVNDiffClient.java:769) at org.tmatesoft.svn.core.wc.SVNDiffClient.doDiff(SVNDiffClient.java:310) at SVNTest.main(SVNTest.java:30)

I have double checked the URLs (I can open them in TortoiseSVN client). Can anybody help me know what is going on? I have posted the code I am running below.

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();
}

1 Answer 1

21

have you called the following static method?

DAVRepositoryFactory.setup();

This needs to be called before accessing any http:// repositories and the similar

SVNRepositoryFactoryImpl.setup();

should be used for svn:// repositories.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.