Agile FAQs
  About   Slides   Home  

 
Managed Chaos
Naresh Jain’s Random Thoughts on Software Development and Adventure Sports
     
`
 
Discovering...
Industrial Logic

Microblog Feed
    Previous Feeds...
    Recent Thoughts

    Recent Comments
    Categories
    Archives
    March 2010
    M T W T F S S
    « Feb    
    1234567
    891011121314
    15161718192021
    22232425262728
    293031  
    RSS Feed
    Add to Technorati Favorites

    svnadmin dump with URL

    Thursday, October 23rd, 2008

    Today, I wanted to move a SVN repository from my windows laptop to my Mac. So I was trying to dump the SVN repository from Windows machine and load it on my Mac. I was accessing my SVN repository via an URL (svn://machine_ip) instead of a Path (file://machine_ip)

    Unfortunately svnadmin dump seems to accept only file paths:

    svnadmin dump svn://localhost/project_name > project_name.svn_dump
    svn: ’svn://localhost/project_name’ is an url when it should be a path

    Luckily I remembered the location of the repository on the file system. So then I tried the following and it worked

    svnadmin dump /users/naresh/local_svn_repos > project_name.svn_dump

    Please note that the local_svn_repo folder must be the actual root of your svn repository. This folder usually contains the following folders:

    • format (file)
    • conf
    • db
    • hooks
    • locks
    • Share/Bookmark

    svn: Unable to open an ra_local session to URL

    Monday, August 4th, 2008

    Currently I’m working on adding Revision Control support to FitNesse. In the process, I’m creating a SVN adapter using svnkit library.

    Once I’ve added a file, if I try to commit the file using

    1
    2
    3
    4
    5
    6
    
    protected void commit(File file) throws SVNException {
    final SVNClientManager manager = SVNClientManager.newInstance();
    final SVNCommitClient commitClient = manager.getCommitClient();
    final File[] filesToCommit = new File[] { file };
    commitClient.doCommit(filesToCommit, false, "Auto Commit", false, false);
    }

    I get the following exception:

    1
    2
    3
    4
    5
    
    svn: Unable to open an ra_local session to URL
    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.wc.SVNCommitClient.doCommit(SVNCommitClient.java:582)
    at org.tmatesoft.svn.core.wc.SVNCommitClient.doCommit(SVNCommitClient.java:549)

    Trying to Google for this, did not take me anywhere. Finally after debugging thru svnkit’s code, I stumbled upon the following line which throws the exception:

    1
    
    SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url));

    Basically, they have SVNRepositoryFactory class which expects the client to register an appropriate driver to handle the given protocol. Their javadocs says:

    Depending on what protocol a user exactly would like to use to access the repository he should first of all set up an appropriate extension of this factory. So, if the user is going to work with the repository via the custom svn-protocol (or svn+xxx) he initially calls

    1
    
    SVNRepositoryFactoryImpl.setup();

    More details: http://svnkit.com/kb/javadoc/org/tmatesoft/svn/core/io/SVNRepositoryFactory.html

    Solution: Since I’m using File System (file://) protocol, I had to add the following line in a static block of my adapter class:

    1
    
    FSRepositoryFactory.setup();
    • Share/Bookmark
        Licensed under
    Creative Commons License
    Design by vikivix