0

I am using SVNKit to checkout svn base repository. Earlier I was using checkout to head for that purpose I was using SVNRevision.HEAD. It was working fine without issue.

below is the syntax of same and revision.Head was used in case of checkout to Head.

doCheckout(SVNURL url,File dstPath,SVNRevision pegRevision,SVNRevision revision, boolean recursive)

but let say if I have to checkout to a specific revision for example 27988, what should be value of pegRevision parameter ?

I am confused please help, I tried HEAD/BASE for pegrevision and also same 27988 etc but it gives error like URL not exist etc .

Just an update, problem was with my code revision was going as 0 always due to some logic issue hence SVN URL was not found and giving error. I tried now with HEAD as pegRevision and 27988 revision works just fine. Thanks!

Dev G
  • 1,387
  • 4
  • 26
  • 43

1 Answers1

0

Well, first, you have to specify an SVNRevision, not an integer.

long targetRev = 27988;
SVNRevision revision = SVNRevision.create( targetRev );
doCheckout(...

As for pegRevision, you almost certainly want SVNRevision.HEAD. As the docs specify, it is:

the revision at which url will be firstly seen in the repository to make sure it's the one that is needed

So, HEAD is usually sufficient. When it's not, things get complicated (and very specific), see the svn book.

roippi
  • 25,533
  • 4
  • 48
  • 73
  • thanks roippi for the reply I am aware that we need SVNRevision. but what confusing me is "the revision at which URL was firstly seen", so what I am doing is checking out complete trunk project on certain revision on which that project exist but inside files which belong to project might have added/deleted/modified. – Dev G Nov 17 '13 at 04:01
  • Just an update, problem was with my code revision was going as 0 always due to some logic issue hence SVN URL was not found and giving error. I tried now with HEAD as pegRevision and 27988 revision works just fine. Thanks! – Dev G Nov 17 '13 at 04:24