0

I need to automatically checkout all svn revisions to do some repo mining.

I wrote a java code using svnkit (org.tmatesoft.svn_1.8.5.standalone_2) The code works nicely when i access the url of the repository but when i do checkout using file:/// protocol, the following svn exception appears.

I searched and found lots of recommendations like version mismatch in client and server. but i do not have client server. I only have a java code.

i checked out a revison recursively in my local drive and then i expect to use the repo in local drive to automatically checkout older revisions in offline mode

I can't figure out the solution and i am a novice.

Do you have any solution?

Exception:

Exception in thread "main" org.tmatesoft.svn.core.SVNException: svn: E180001: Unable to open an ra_local session to URL
svn: E180001: Unable to open repository 'file:///c:/repos/lego'
svn: E180001: Unable to open repository 'file:///c:/repos/lego'
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)
    at org.tmatesoft.svn.core.internal.io.fs.FSRepository.openRepository(FSRepository.java:796)
    at org.tmatesoft.svn.core.internal.io.fs.FSRepository.testConnection(FSRepository.java:105)
    at org.tmatesoft.svn.core.io.SVNRepository.getRepositoryRoot(SVNRepository.java:323)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAbstractUpdate.checkout(SvnNgAbstractUpdate.java:768)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCheckout.run(SvnNgCheckout.java:16)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCheckout.run(SvnNgCheckout.java:10)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner.run(SvnNgOperationRunner.java:20)
    at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:20)
    at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1149)
    at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:777)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:662)
    at SVNHelper.doCheckou(SVNHelper.java:77)
    at process2.main(process2.java:20)
Seelenvirtuose
  • 20,273
  • 6
  • 37
  • 66
user3610899
  • 121
  • 2
  • 7
  • "i checked out a revison recursively in my local drive" -- Does that mean that the directory `C:\repos\lego` is not a SVN repository, but a checked out SVN directory? In that case, you cannot check it out from there. – Seelenvirtuose May 07 '14 at 07:01
  • Yes.I tested two options: a folder which i did automatic checkout and a folder that i did checkout using tortoise. – user3610899 May 07 '14 at 07:02
  • So, how can i have svn repo locally in my local machine? – user3610899 May 07 '14 at 07:03
  • You did not exactly explain what you are trying to do ... but ... you can only checkout from a SVN repository. The file: protocol is just another prefix for a URL. Nothing strange. So, if you have setup a SVN repo on your local machine, it is possible to checkout from there with a file URL. But I think, that you want to access a remote SVN repo. So you simply must checkout from there. – Seelenvirtuose May 07 '14 at 07:11
  • I am doing repo mining and i need to checkout nearly 2000 revision from a remote repository. I think it is faster to transfer the repository to my local drive and then run my mining code. I do not know how to do it? – user3610899 May 07 '14 at 07:14
  • Checking out also means that you only have a specific revision of your repo on your local machine. You cannot use the working directory (the checked out one) and "see" it as the SVN repo. Point. Checking out _must_ be done from the SVN repo. – Seelenvirtuose May 07 '14 at 07:32
  • Many thanks for the answer. How can I have the remote svn repo in local directory – user3610899 May 07 '14 at 09:45
  • Thank you again. I created a svn repo and syn it. – user3610899 May 08 '14 at 02:25

1 Answers1

1

Thanks Seelenvirtuose

I used checked out folder as a repository and, therefore it was unable to open ra_local session..

I solved the problem by creating local repository and syncing it with remote one. To do so i followed the recommended steps in [1, 2]

Now it works :)

[1] How do I export (and then import) a Subversion repository? [2] http://slopjong.de/2010/01/20/let-svn-accept-revision-propchanges/

Community
  • 1
  • 1
user3610899
  • 121
  • 2
  • 7