Reputation: 1410
I am using the following to get the SVNRevision number.
However, i expected 18, 19, 20, 21. But it keeps returning 13, regardless of my latest commits.
Loads of sources say to use the below code though. So why am I not getting the correct numbers.
import org.tmatesoft.svn.core.wc.*
def getSvnRevision(){
ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
SVNClientManager clientManager = SVNClientManager.newInstance(options);
SVNStatusClient statusClient = clientManager.getStatusClient();
SVNStatus status = statusClient.doStatus(projectDir, false);
SVNRevision revision = status.getRevision();
return revision.getNumber();
}
Upvotes: 0
Views: 270
Reputation: 13855
If its like eclipse, you need to update your project, for the version number locally to increase. Submitting does not seem to update the local files version numbers. Aka, I always commit, then update, so that my project is showing the correct SVN version.
This could be by design too (SVN), not sure.
Upvotes: 1