Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get all revisions (not latest) for a special file using SVNkit?

Tags:

java

svn

svnkit

I have used a sample java code to get a file's revision history, but only got one revision. There are many revisions in respository for this file. So how can I get all revisions for this file at once?

…
long startRevision = -1;
long endRevision = 0; //HEAD (i.e. the latest) revision

SVNRepositoryFactoryImpl.setup();
repository = SVNRepositoryFactory.create( SVNURL.parseURIEncoded(url) );
ISVNAuthenticationManager authManager = 
         SVNWCUtil.createDefaultAuthenticationManager( name, password );
repository.setAuthenticationManager( authManager );

Collection logEntries = null;
logEntries = repository.log( new String[] { "EJB.java" }, null, startRevision,
                             endRevision, true, true );
…
like image 328
bombyx Avatar asked Dec 03 '25 18:12

bombyx


1 Answers

Use 0 for start revision and -1 for end revision

like image 56
Elvis Avatar answered Dec 06 '25 09:12

Elvis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!