« Return to Thread: Retrieving a URL of an existing working copy

Re: Retrieving a URL of an existing working copy

by Alexander Kitaev-3 :: Rate this Message:

Reply to Author | View in Thread

Hello,

You should use 'info' command to get working copy URL:

SVNWCClient client = SVNClientManager.newInstance().getWCClient();
SVNInfo info = client.doInfo(path, SVNRevision.WORKING);
SVNURL url = info.getURL();
...

// then to check out
SVNUpdateClient client = SVNClientManager.newInstance().getUpdateClient();
client.doCheckout(url, ...);


Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

Ryan Cuprak wrote:

> Hello,
> Is there a way to retrieve the SVN url of an existing working copy? In
> the application I am working on I allow the user to select an existing
> working copy. This working copy would have been checked out from either
> Eclipse or the svn command line utilities. I've been digging through the
> APIs but nothing sticks out. What I want to do, retrieve the URL to the
> repository and then create an instance of the SVNRepository via the
> SVNRepositoryFactory and call the testConnection() method to verify the
> security credentials. However, I need an SVNURL to pass to the
> SVNRepositoryFactory but I am not sure where I can get it if all I have
> a file pointing at a directory in the working copy.
>
> Thanks!
> -Ryan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svnkit-users-unsubscribe@...
> For additional commands, e-mail: svnkit-users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...

 « Return to Thread: Retrieving a URL of an existing working copy