private String getRevisionForTag()

in src/main/java/org/apache/maven/plugin/changelog/ChangeLogReport.java [758:783]


    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();
            infoCommand.setLogger( new DefaultLog() );

            InfoScmResult infoScmResult =
                infoCommand.executeInfoTagCommand( (SvnScmProviderRepository) repository.getProviderRepository(),
                                                   new ScmFileSet( basedir ), tag, null, false, null );
            if ( infoScmResult.getInfoItems().size() == 0 )
            {
                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;
    }