svn:// urls not working.

Former SVN Browser
dmosses
Posts: 1
Joined: Mon Apr 16, 2007 4:06 pm

svn:// urls not working.

Postby dmosses » Mon Apr 16, 2007 4:29 pm

Sorry if I'm covering old ground and this has been fixed in the latest nightly build, but I thought that this should have been working in the latest stable release 2.5.0 I downloaded today - it's not.

If I try to access a repository using url svn://myserver I'm told that my username and password are incorrect. They're not.
Looking in the logs there's an exception trying to create the connection to the SVNRepository.

I've downloaded the source, and taking a look at the code it looks like
org.polarion.svnwebclient.data.javasvn.DataProvider only calls

Code: Select all

DAVRepositoryFactory.setup()
to initialise the repository factory. This will only work for http based urls.

SVNRepositoryFactoryImpl.setup() should be called if the URL is a svn based url, and FSRepositoryFactory.setup() for file system based urls (later versions of SVNKit only).

Also, org.polarion.svnwebclient.data.javasvn.SVNRepositoryPool doesn't seem to call the appropriate .setup() method at all!

I've written a small utility class that will perform the correct initialisation and replaced calls to DAVRepositoryFactory.setup() in DataProvider with SVNRepositoryFactoryUtil.setupRepositoryFactory(url).



Code: Select all

package org.polarion.svnwebclient.util;

import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl;

/**
 *
 * @author david.moss
 */
public class SVNRepositoryFactoryUtil
{
   
    /** Creates a new instance of SVNRepositoryFactoryUtil */
    protected SVNRepositoryFactoryUtil()
    {
    }
   
    /**
     * Initialise the correct repository factory implementation
     */
    public static void setupRepositoryFactory(String url)
    {
        //if using svn[+xxx] protocol, initialise SVNRepositoryFactoryImpl
        String lowerURL = url.toLowerCase();
        if(lowerURL.startsWith("url") || lowerURL.startsWith("url+"))
        {
            SVNRepositoryFactoryImpl.setup();
        }
        //use DAVRepositoryFactor if using http[s][+xxx] urls
        else if(lowerURL.startsWith("http") || lowerURL.startsWith("https"))
        {
            DAVRepositoryFactory.setup();
        }
        //use FSRepositoryFactory for file system urls
//        else if(lowerURL.startsWith("file"))
//        {
//            FSRepositoryFactory.setup();      //Later versions of SVNKit only
//        }
        //a reasonable default?
        else
        {
            //default to plain svn?
            SVNRepositoryFactoryImpl.setup();
        }
    } 
}


After rebuilding, everything seems to be working correctly.

Again, if this has already been fixed forgive me. If not, hope it helps! :-)

Return to “Polarion SVN Web Client”

Who is online

Users browsing this forum: No registered users and 2 guests