Hello Nestor,
I'm not sure what you mean by "the first revision" but probably the following
code will help:
final SvnOperationFactory svnOperationFactory = new
SvnOperationFactory();
try {
final SvnLog log = svnOperationFactory.createLog();
log.setStopOnCopy(stopOnCopy);
log.setLimit(1); //get only one revision (the first one)
log.addRange(SvnRevisionRange.create(SVNRevision.create(1),
SVNRevision.HEAD));
log.setSingleTarget(SvnTarget.fromURL(url.appendPath("path/to/file", false),
SVNRevision.HEAD));
final SVNLogEntry logEntry = log.run();
final long revision = logEntry.getRevision();
System.out.println("revision = " + revision);
} finally {
svnOperationFactory.dispose();
}
Set 'stopOnCopy' depending on your requirements: if at some revision your
"targetFile" was created
as a copy of some "sourceFile", should we consider that revision as the first
revision or should we
scan history of "sourceFile" to find the first revision.
--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge
> Hi
>
> I'm trying to get the first revision of the files I'm extracting using
> SVNKit 1.8.10. Because I don't see a method or property that return this
> value I have to use getFileRevision from 0 to the repository's latest
> revision to see which is the first revision. I tried searching from 0 to
> the entry latest revision but I get the following error:
>
> "File" is not a file in revision "entry revision"
>
> So each time I want to get the first revision I have to iterate from 0 to
> the repository's last revision just to get one revision and it's very slow.
> Is there a more efficient way?
>
> Regards,
>
> Néstor