private String getRevisionForTag()

in src/main/java/org/apache/maven/plugins/changelog/ChangeLogReport.java [680:704]


    private String getRevisionForTag(final String tag, final ScmRepository repository, final ScmProvider provider)
            throws ScmException {
        if (repository.getProvider().equals("svn")) {
            if (tag == null) {
                return "HEAD";
            }
            SvnInfoCommandExpanded infoCommand = new SvnInfoCommandExpanded();

            InfoScmResult infoScmResult = infoCommand.executeInfoTagCommand(
                    (SvnScmProviderRepository) repository.getProviderRepository(),
                    new ScmFileSet(basedir),
                    tag,
                    null,
                    false,
                    null);
            if (infoScmResult.getInfoItems().isEmpty()) {
                throw new ScmException("There is no tag named '" + tag + "' in the Subversion repository.");
            }
            InfoItem infoItem = infoScmResult.getInfoItems().get(0);
            String revision = infoItem.getLastChangedRevision();
            getLog().info(String.format("Resolved tag '%s' to revision '%s'", tag, revision));
            return revision;
        }
        return tag;
    }