Search in sources :

Example 1 with LastRevisionInfo

use of net.nemerosa.ontrack.extension.svn.model.LastRevisionInfo in project ontrack by nemerosa.

the class IndexationServiceImpl method getLastRevisionInfo.

@Override
public LastRevisionInfo getLastRevisionInfo(String name) {
    try (Transaction ignored = transactionService.start()) {
        SVNRepository repository = getRepositoryByName(name);
        SVNURL url = SVNUtils.toURL(repository.getConfiguration().getUrl());
        long repositoryRevision = svnClient.getRepositoryRevision(repository, url);
        TRevision r = revisionDao.getLastRevision(repository.getId());
        if (r != null) {
            return new LastRevisionInfo(r.getRevision(), r.getMessage(), repositoryRevision);
        } else {
            return LastRevisionInfo.none(repositoryRevision);
        }
    }
}
Also used : LastRevisionInfo(net.nemerosa.ontrack.extension.svn.model.LastRevisionInfo) Transaction(net.nemerosa.ontrack.tx.Transaction)

Aggregations

LastRevisionInfo (net.nemerosa.ontrack.extension.svn.model.LastRevisionInfo)1 Transaction (net.nemerosa.ontrack.tx.Transaction)1