How to Check out code given a revision number?

View: New views
7 Messages — Rating Filter:   Alert me  

How to Check out code given a revision number?

by fantastic_ray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone,
I'm sorry I'm asking something trivial, but I've been reading the wiki all morning and I'm just more confused right now.
I need to check out code from SVN for a older version of the code and I have the version number, say 45 in my case. After authentication (using code from the wiki), and creating a directory in my local file system, what's the next step?
Can someone please help?

Re: How to Check out code given a revision number?

by Alexander Sinyushkin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

What level API are you interested in? If it's something to do with a
working copy then refer to SVNUpdateClient class and its doCheckout()
methods. If you want just to get a revision data and store it in a
custom way, then you need to utilize an SVNRepository repository access
driver and implement your own ISVNEditor to handle the update tree
structure (look at https://wiki.svnkit.com/Updating_From_A_Repository -
at the bottom of the wiki article you may find a link to the Export.java
example class source, but it's already adopted to the trunk version of
SVNKit which is now not API compatible with the previous releases of
SVNKit; but you can always find the same example source for every
release in its project tree, not only in trunk itself).
----
Alexander Sinyushkin,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

fantastic_ray wrote:
> Hi everyone,
> I'm sorry I'm asking something trivial, but I've been reading the wiki all
> morning and I'm just more confused right now.
> I need to check out code from SVN for a older version of the code and I have
> the version number, say 45 in my case. After authentication (using code from
> the wiki), and creating a directory in my local file system, what's the next
> step?
> Can someone please help?

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


Re: How to Check out code given a revision number?

by fantastic_ray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
This is what I'm trying based on your advice. I'm still getting errors though:
public class TestClass
{
        public static void main(String args[]) throws Exception
        {
                File importDir = new File(ConfigValues.localBaseVersionPath);
                if (!importDir.exists())
                        importDir.mkdirs();

                String username = ConfigValues.username;
                String password = ConfigValues.password;
                String srcRepositoryURL = ConfigValues.srcRepositoryUrl;

                SVNUpdateClient client =
                        new SVNUpdateClient(SVNWCUtil.createDefaultAuthenticationManager( username , password ), SVNWCUtil.createDefaultOptions(true));
                client.doCheckout(SVNURL.parseURIDecoded( srcRepositoryURL ) , importDir, SVNRevision.create(0), SVNRevision.create(44), true);
        }
}


I'm getting the error:
Exception in thread "main" org.tmatesoft.svn.core.SVNException: svn: Unable to create SVNRepository object for 'http://mycode-code.svnrepository.com/svn/mycode-code/TestProject'
        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.io.SVNRepositoryFactory.create(SVNRepositoryFactory.java:199)
        at org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool.createRepository(DefaultSVNRepositoryPool.java:213)
        at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:231)
        at org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:459)
        at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:418)
        at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:382)
        at org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:305)
        at com.wwe.cds.engine.test.TestClass.main(TestClass.java:24)

Please tell me what I am doing wrong.

Thanks.
Alexander Sinyushkin-2 wrote:
Hello,

What level API are you interested in? If it's something to do with a
working copy then refer to SVNUpdateClient class and its doCheckout()
methods. If you want just to get a revision data and store it in a
custom way, then you need to utilize an SVNRepository repository access
driver and implement your own ISVNEditor to handle the update tree
structure (look at https://wiki.svnkit.com/Updating_From_A_Repository -
at the bottom of the wiki article you may find a link to the Export.java
example class source, but it's already adopted to the trunk version of
SVNKit which is now not API compatible with the previous releases of
SVNKit; but you can always find the same example source for every
release in its project tree, not only in trunk itself).
----
Alexander Sinyushkin,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

fantastic_ray wrote:
> Hi everyone,
> I'm sorry I'm asking something trivial, but I've been reading the wiki all
> morning and I'm just more confused right now.
> I need to check out code from SVN for a older version of the code and I have
> the version number, say 45 in my case. After authentication (using code from
> the wiki), and creating a directory in my local file system, what's the next
> step?
> Can someone please help?

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

Re: How to Check out code given a revision number?

by Alexander Sinyushkin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You haven't called DAVRepositoryFactory.setup() method. In wiki articles
it is mentioned that the SVNKit library should be initialized first
prior to using:

https://wiki.svnkit.com/Getting_Started_With_SVNKit#head-33d8876ff8190712d0051efddc00b3c457c28a47
----
Alexander Sinyushkin,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

fantastic_ray wrote:

> Hi,
> This is what I'm trying based on your advice. I'm still getting errors
> though:
> public class TestClass
> {
> public static void main(String args[]) throws Exception
> {
> File importDir = new File(ConfigValues.localBaseVersionPath);
> if (!importDir.exists())
> importDir.mkdirs();
>
> String username = ConfigValues.username;
> String password = ConfigValues.password;
> String srcRepositoryURL = ConfigValues.srcRepositoryUrl;
>
> SVNUpdateClient client =
> new SVNUpdateClient(SVNWCUtil.createDefaultAuthenticationManager(
> username , password ), SVNWCUtil.createDefaultOptions(true));
> client.doCheckout(SVNURL.parseURIDecoded( srcRepositoryURL ) , importDir,
> SVNRevision.create(0), SVNRevision.create(44), true);
> }
> }
>
>
> I'm getting the error:
> Exception in thread "main" org.tmatesoft.svn.core.SVNException: svn: Unable
> to create SVNRepository object for
> 'http://mycode-code.svnrepository.com/svn/mycode-code/TestProject'
> 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.io.SVNRepositoryFactory.create(SVNRepositoryFactory.java:199)
> at
> org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool.createRepository(DefaultSVNRepositoryPool.java:213)
> at
> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:231)
> at
> org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:459)
> at
> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:418)
> at
> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:382)
> at
> org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:305)
> at com.wwe.cds.engine.test.TestClass.main(TestClass.java:24)
>
> Please tell me what I am doing wrong.
>
> Thanks.
>
> Alexander Sinyushkin-2 wrote:
>> Hello,
>>
>> What level API are you interested in? If it's something to do with a
>> working copy then refer to SVNUpdateClient class and its doCheckout()
>> methods. If you want just to get a revision data and store it in a
>> custom way, then you need to utilize an SVNRepository repository access
>> driver and implement your own ISVNEditor to handle the update tree
>> structure (look at https://wiki.svnkit.com/Updating_From_A_Repository -
>> at the bottom of the wiki article you may find a link to the Export.java
>> example class source, but it's already adopted to the trunk version of
>> SVNKit which is now not API compatible with the previous releases of
>> SVNKit; but you can always find the same example source for every
>> release in its project tree, not only in trunk itself).
>> ----
>> Alexander Sinyushkin,
>> TMate Software,
>> http://svnkit.com/ - Java [Sub]Versioning Library!
>>
>> fantastic_ray wrote:
>>> Hi everyone,
>>> I'm sorry I'm asking something trivial, but I've been reading the wiki
>>> all
>>> morning and I'm just more confused right now.
>>> I need to check out code from SVN for a older version of the code and I
>>> have
>>> the version number, say 45 in my case. After authentication (using code
>>> from
>>> the wiki), and creating a directory in my local file system, what's the
>>> next
>>> step?
>>> Can someone please help?
>> ---------------------------------------------------------------------
>> 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@...


Re: How to Check out code given a revision number?

by fantastic_ray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

oh Sorry, I did that but I still continue to get some other errors:
I added the line:
DAVRepositoryFactory.setup();

so my code is:
String username = ConfigValues.username;
                String password = ConfigValues.password;
                String srcRepositoryURL = ConfigValues.srcRepositoryUrl;

                SVNRepository repository = null;
                ISVNAuthenticationManager authManager = null;

                DAVRepositoryFactory.setup();

                repository = SVNRepositoryFactory.create( SVNURL.parseURIDecoded( srcRepositoryURL ), null );
                authManager = SVNWCUtil.createDefaultAuthenticationManager( username , password );
                repository.setAuthenticationManager( authManager );

                SVNUpdateClient client =
                        new SVNUpdateClient(authManager , SVNWCUtil.createDefaultOptions(true));
                client.doCheckout(SVNURL.parseURIDecoded( srcRepositoryURL ) , importDir, SVNRevision.create(0), SVNRevision.create(44), true);

But I get the error :
Exception in thread "main" org.tmatesoft.svn.core.SVNException: svn: '/svn/mycode-code/!svn/bc/0/TestProject' path not found: 404 Not Found (http://mycode-code.svnrepository.com)
        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.internal.io.dav.DAVRepository.getLocations(DAVRepository.java:568)
        at org.tmatesoft.svn.core.io.SVNRepository.getLocations(SVNRepository.java:1122)
        at org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:486)
        at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:418)
        at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:382)
        at org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:305)
        at com.wwe.cds.engine.test.TestClass.main(TestClass.java:40)


Alexander Sinyushkin-2 wrote:
You haven't called DAVRepositoryFactory.setup() method. In wiki articles
it is mentioned that the SVNKit library should be initialized first
prior to using:

https://wiki.svnkit.com/Getting_Started_With_SVNKit#head-33d8876ff8190712d0051efddc00b3c457c28a47
----
Alexander Sinyushkin,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

fantastic_ray wrote:
> Hi,
> This is what I'm trying based on your advice. I'm still getting errors
> though:
> public class TestClass
> {
> public static void main(String args[]) throws Exception
> {
> File importDir = new File(ConfigValues.localBaseVersionPath);
> if (!importDir.exists())
> importDir.mkdirs();
>
> String username = ConfigValues.username;
> String password = ConfigValues.password;
> String srcRepositoryURL = ConfigValues.srcRepositoryUrl;
>
> SVNUpdateClient client =
> new SVNUpdateClient(SVNWCUtil.createDefaultAuthenticationManager(
> username , password ), SVNWCUtil.createDefaultOptions(true));
> client.doCheckout(SVNURL.parseURIDecoded( srcRepositoryURL ) , importDir,
> SVNRevision.create(0), SVNRevision.create(44), true);
> }
> }
>
>
> I'm getting the error:
> Exception in thread "main" org.tmatesoft.svn.core.SVNException: svn: Unable
> to create SVNRepository object for
> 'http://mycode-code.svnrepository.com/svn/mycode-code/TestProject'
> 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.io.SVNRepositoryFactory.create(SVNRepositoryFactory.java:199)
> at
> org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool.createRepository(DefaultSVNRepositoryPool.java:213)
> at
> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:231)
> at
> org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:459)
> at
> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:418)
> at
> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:382)
> at
> org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:305)
> at com.wwe.cds.engine.test.TestClass.main(TestClass.java:24)
>
> Please tell me what I am doing wrong.
>
> Thanks.
>
> Alexander Sinyushkin-2 wrote:
>> Hello,
>>
>> What level API are you interested in? If it's something to do with a
>> working copy then refer to SVNUpdateClient class and its doCheckout()
>> methods. If you want just to get a revision data and store it in a
>> custom way, then you need to utilize an SVNRepository repository access
>> driver and implement your own ISVNEditor to handle the update tree
>> structure (look at https://wiki.svnkit.com/Updating_From_A_Repository -
>> at the bottom of the wiki article you may find a link to the Export.java
>> example class source, but it's already adopted to the trunk version of
>> SVNKit which is now not API compatible with the previous releases of
>> SVNKit; but you can always find the same example source for every
>> release in its project tree, not only in trunk itself).
>> ----
>> Alexander Sinyushkin,
>> TMate Software,
>> http://svnkit.com/ - Java [Sub]Versioning Library!
>>
>> fantastic_ray wrote:
>>> Hi everyone,
>>> I'm sorry I'm asking something trivial, but I've been reading the wiki
>>> all
>>> morning and I'm just more confused right now.
>>> I need to check out code from SVN for a older version of the code and I
>>> have
>>> the version number, say 45 in my case. After authentication (using code
>>> from
>>> the wiki), and creating a directory in my local file system, what's the
>>> next
>>> step?
>>> Can someone please help?
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: svnkit-users-unsubscribe@svnkit.com
>> For additional commands, e-mail: svnkit-users-help@svnkit.com
>>
>>
>>
>

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

Re: How to Check out code given a revision number?

by Alexander Sinyushkin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That must be because you've passed pegRevision = 0. I extremely doubt
that you have anything except the root of the repository in revision 0
(unless you are checking out the root exactly :) ). So, just pass
SVNRevision.UNDEFINED as a pegRevision.

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

fantastic_ray wrote:

> oh Sorry, I did that but I still continue to get some other errors:
> I added the line:
> DAVRepositoryFactory.setup();
>
> so my code is:
> String username = ConfigValues.username;
> String password = ConfigValues.password;
> String srcRepositoryURL = ConfigValues.srcRepositoryUrl;
>
> SVNRepository repository = null;
> ISVNAuthenticationManager authManager = null;
>
> DAVRepositoryFactory.setup();
>
> repository = SVNRepositoryFactory.create( SVNURL.parseURIDecoded(
> srcRepositoryURL ), null );
> authManager = SVNWCUtil.createDefaultAuthenticationManager( username ,
> password );
> repository.setAuthenticationManager( authManager );
>
> SVNUpdateClient client =
> new SVNUpdateClient(authManager , SVNWCUtil.createDefaultOptions(true));
> client.doCheckout(SVNURL.parseURIDecoded( srcRepositoryURL ) , importDir,
> SVNRevision.create(0), SVNRevision.create(44), true);
>
> But I get the error :
> Exception in thread "main" org.tmatesoft.svn.core.SVNException: svn:
> '/svn/mycode-code/!svn/bc/0/TestProject' path not found: 404 Not Found
> (http://mycode-code.svnrepository.com)
> 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.internal.io.dav.DAVRepository.getLocations(DAVRepository.java:568)
> at
> org.tmatesoft.svn.core.io.SVNRepository.getLocations(SVNRepository.java:1122)
> at
> org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:486)
> at
> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:418)
> at
> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:382)
> at
> org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:305)
> at com.wwe.cds.engine.test.TestClass.main(TestClass.java:40)
>
>
>
> Alexander Sinyushkin-2 wrote:
>> You haven't called DAVRepositoryFactory.setup() method. In wiki articles
>> it is mentioned that the SVNKit library should be initialized first
>> prior to using:
>>
>> https://wiki.svnkit.com/Getting_Started_With_SVNKit#head-33d8876ff8190712d0051efddc00b3c457c28a47
>> ----
>> Alexander Sinyushkin,
>> TMate Software,
>> http://svnkit.com/ - Java [Sub]Versioning Library!
>>
>> fantastic_ray wrote:
>>> Hi,
>>> This is what I'm trying based on your advice. I'm still getting errors
>>> though:
>>> public class TestClass
>>> {
>>> public static void main(String args[]) throws Exception
>>> {
>>> File importDir = new File(ConfigValues.localBaseVersionPath);
>>> if (!importDir.exists())
>>> importDir.mkdirs();
>>>
>>> String username = ConfigValues.username;
>>> String password = ConfigValues.password;
>>> String srcRepositoryURL = ConfigValues.srcRepositoryUrl;
>>>
>>> SVNUpdateClient client =
>>> new SVNUpdateClient(SVNWCUtil.createDefaultAuthenticationManager(
>>> username , password ), SVNWCUtil.createDefaultOptions(true));
>>> client.doCheckout(SVNURL.parseURIDecoded( srcRepositoryURL ) ,
>>> importDir,
>>> SVNRevision.create(0), SVNRevision.create(44), true);
>>> }
>>> }
>>>
>>>
>>> I'm getting the error:
>>> Exception in thread "main" org.tmatesoft.svn.core.SVNException: svn:
>>> Unable
>>> to create SVNRepository object for
>>> 'http://mycode-code.svnrepository.com/svn/mycode-code/TestProject'
>>> 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.io.SVNRepositoryFactory.create(SVNRepositoryFactory.java:199)
>>> at
>>> org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool.createRepository(DefaultSVNRepositoryPool.java:213)
>>> at
>>> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:231)
>>> at
>>> org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:459)
>>> at
>>> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:418)
>>> at
>>> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:382)
>>> at
>>> org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:305)
>>> at com.wwe.cds.engine.test.TestClass.main(TestClass.java:24)
>>>
>>> Please tell me what I am doing wrong.
>>>
>>> Thanks.
>>>
>>> Alexander Sinyushkin-2 wrote:
>>>> Hello,
>>>>
>>>> What level API are you interested in? If it's something to do with a
>>>> working copy then refer to SVNUpdateClient class and its doCheckout()
>>>> methods. If you want just to get a revision data and store it in a
>>>> custom way, then you need to utilize an SVNRepository repository access
>>>> driver and implement your own ISVNEditor to handle the update tree
>>>> structure (look at https://wiki.svnkit.com/Updating_From_A_Repository -
>>>> at the bottom of the wiki article you may find a link to the Export.java
>>>> example class source, but it's already adopted to the trunk version of
>>>> SVNKit which is now not API compatible with the previous releases of
>>>> SVNKit; but you can always find the same example source for every
>>>> release in its project tree, not only in trunk itself).
>>>> ----
>>>> Alexander Sinyushkin,
>>>> TMate Software,
>>>> http://svnkit.com/ - Java [Sub]Versioning Library!
>>>>
>>>> fantastic_ray wrote:
>>>>> Hi everyone,
>>>>> I'm sorry I'm asking something trivial, but I've been reading the wiki
>>>>> all
>>>>> morning and I'm just more confused right now.
>>>>> I need to check out code from SVN for a older version of the code and I
>>>>> have
>>>>> the version number, say 45 in my case. After authentication (using code
>>>>> from
>>>>> the wiki), and creating a directory in my local file system, what's the
>>>>> next
>>>>> step?
>>>>> Can someone please help?
>>>> ---------------------------------------------------------------------
>>>> 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@...
>>
>>
>>
>

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


Re: How to Check out code given a revision number?

by fantastic_ray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It works! Life is good again ! 

Alexander Sinyushkin-2 wrote:
That must be because you've passed pegRevision = 0. I extremely doubt
that you have anything except the root of the repository in revision 0
(unless you are checking out the root exactly :) ). So, just pass
SVNRevision.UNDEFINED as a pegRevision.

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

fantastic_ray wrote:
> oh Sorry, I did that but I still continue to get some other errors:
> I added the line:
> DAVRepositoryFactory.setup();
>
> so my code is:
> String username = ConfigValues.username;
> String password = ConfigValues.password;
> String srcRepositoryURL = ConfigValues.srcRepositoryUrl;
>
> SVNRepository repository = null;
> ISVNAuthenticationManager authManager = null;
>
> DAVRepositoryFactory.setup();
>
> repository = SVNRepositoryFactory.create( SVNURL.parseURIDecoded(
> srcRepositoryURL ), null );
> authManager = SVNWCUtil.createDefaultAuthenticationManager( username ,
> password );
> repository.setAuthenticationManager( authManager );
>
> SVNUpdateClient client =
> new SVNUpdateClient(authManager , SVNWCUtil.createDefaultOptions(true));
> client.doCheckout(SVNURL.parseURIDecoded( srcRepositoryURL ) , importDir,
> SVNRevision.create(0), SVNRevision.create(44), true);
>
> But I get the error :
> Exception in thread "main" org.tmatesoft.svn.core.SVNException: svn:
> '/svn/mycode-code/!svn/bc/0/TestProject' path not found: 404 Not Found
> (http://mycode-code.svnrepository.com)
> 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.internal.io.dav.DAVRepository.getLocations(DAVRepository.java:568)
> at
> org.tmatesoft.svn.core.io.SVNRepository.getLocations(SVNRepository.java:1122)
> at
> org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:486)
> at
> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:418)
> at
> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:382)
> at
> org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:305)
> at com.wwe.cds.engine.test.TestClass.main(TestClass.java:40)
>
>
>
> Alexander Sinyushkin-2 wrote:
>> You haven't called DAVRepositoryFactory.setup() method. In wiki articles
>> it is mentioned that the SVNKit library should be initialized first
>> prior to using:
>>
>> https://wiki.svnkit.com/Getting_Started_With_SVNKit#head-33d8876ff8190712d0051efddc00b3c457c28a47
>> ----
>> Alexander Sinyushkin,
>> TMate Software,
>> http://svnkit.com/ - Java [Sub]Versioning Library!
>>
>> fantastic_ray wrote:
>>> Hi,
>>> This is what I'm trying based on your advice. I'm still getting errors
>>> though:
>>> public class TestClass
>>> {
>>> public static void main(String args[]) throws Exception
>>> {
>>> File importDir = new File(ConfigValues.localBaseVersionPath);
>>> if (!importDir.exists())
>>> importDir.mkdirs();
>>>
>>> String username = ConfigValues.username;
>>> String password = ConfigValues.password;
>>> String srcRepositoryURL = ConfigValues.srcRepositoryUrl;
>>>
>>> SVNUpdateClient client =
>>> new SVNUpdateClient(SVNWCUtil.createDefaultAuthenticationManager(
>>> username , password ), SVNWCUtil.createDefaultOptions(true));
>>> client.doCheckout(SVNURL.parseURIDecoded( srcRepositoryURL ) ,
>>> importDir,
>>> SVNRevision.create(0), SVNRevision.create(44), true);
>>> }
>>> }
>>>
>>>
>>> I'm getting the error:
>>> Exception in thread "main" org.tmatesoft.svn.core.SVNException: svn:
>>> Unable
>>> to create SVNRepository object for
>>> 'http://mycode-code.svnrepository.com/svn/mycode-code/TestProject'
>>> 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.io.SVNRepositoryFactory.create(SVNRepositoryFactory.java:199)
>>> at
>>> org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool.createRepository(DefaultSVNRepositoryPool.java:213)
>>> at
>>> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:231)
>>> at
>>> org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:459)
>>> at
>>> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:418)
>>> at
>>> org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:382)
>>> at
>>> org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:305)
>>> at com.wwe.cds.engine.test.TestClass.main(TestClass.java:24)
>>>
>>> Please tell me what I am doing wrong.
>>>
>>> Thanks.
>>>
>>> Alexander Sinyushkin-2 wrote:
>>>> Hello,
>>>>
>>>> What level API are you interested in? If it's something to do with a
>>>> working copy then refer to SVNUpdateClient class and its doCheckout()
>>>> methods. If you want just to get a revision data and store it in a
>>>> custom way, then you need to utilize an SVNRepository repository access
>>>> driver and implement your own ISVNEditor to handle the update tree
>>>> structure (look at https://wiki.svnkit.com/Updating_From_A_Repository -
>>>> at the bottom of the wiki article you may find a link to the Export.java
>>>> example class source, but it's already adopted to the trunk version of
>>>> SVNKit which is now not API compatible with the previous releases of
>>>> SVNKit; but you can always find the same example source for every
>>>> release in its project tree, not only in trunk itself).
>>>> ----
>>>> Alexander Sinyushkin,
>>>> TMate Software,
>>>> http://svnkit.com/ - Java [Sub]Versioning Library!
>>>>
>>>> fantastic_ray wrote:
>>>>> Hi everyone,
>>>>> I'm sorry I'm asking something trivial, but I've been reading the wiki
>>>>> all
>>>>> morning and I'm just more confused right now.
>>>>> I need to check out code from SVN for a older version of the code and I
>>>>> have
>>>>> the version number, say 45 in my case. After authentication (using code
>>>>> from
>>>>> the wiki), and creating a directory in my local file system, what's the
>>>>> next
>>>>> step?
>>>>> Can someone please help?
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: svnkit-users-unsubscribe@svnkit.com
>>>> For additional commands, e-mail: svnkit-users-help@svnkit.com
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: svnkit-users-unsubscribe@svnkit.com
>> For additional commands, e-mail: svnkit-users-help@svnkit.com
>>
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@svnkit.com
For additional commands, e-mail: svnkit-users-help@svnkit.com
LightInTheBox - Buy quality products at wholesale price