[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

repository root and imported projects

From: Panagiotis Korros <panagiotis.korros_at_gmail.com>
Date: 2005-11-28 21:00:13 CET

Hi to all,

I noticed that in subversion 1.3 there is a new field in the working
copy that stores the repository root (as described in
http://svn.collab.net/repos/svn/branches/1.3.x/CHANGES and issue
#960). That means that the following code...

SVNClient client = new SVNClient();
String path = "C:\\Projects\\subversion\\subclipse\\core";
String repositoryRoot = client.info(path).getRepository();

will return the repository root for 1.3 working copies or null for pre
1.3 working copies.

we can take advantage of it when we auto share imported projects

in SVNWorkspaceRoot.setSharing(...)
...
 String repositoryUrl = codeToGetTheRepositoryRoot(project);
        if( repositoryUrl == null ) {
                // means that we have a pre svn 1.3 working copy that
                // doesn't store the repository root url locally
                repositoryUrl = status.getUrlString();
        }

        // Ensure that the provided location is managed
        SVNProviderPlugin.getPlugin().getRepositories().getRepository(repositoryUrl);

Regards,

Panagiotis

--
Take back the web http://www.getfirefox.com
Received on Tue Nov 29 07:00:13 2005

This is an archived mail posted to the Subclipse Dev mailing list.