if ( scmResult.getChanges() != null && !scmResult.getChanges().isEmpty() )
{
for ( org.apache.maven.scm.ChangeSet scmChangeSet : (List<org.apache.maven.scm.ChangeSet>) scmResult.getChanges() )
{
ChangeSet change = new ChangeSet();
change.setAuthor( scmChangeSet.getAuthor() );
change.setComment( scmChangeSet.getComment() );
if ( scmChangeSet.getDate() != null )
{
change.setDate( scmChangeSet.getDate().getTime() );
}
if ( scmChangeSet.getFiles() != null )
{
for ( org.apache.maven.scm.ChangeFile f : (List<org.apache.maven.scm.ChangeFile>) scmChangeSet.getFiles() )
{
ChangeFile file = new ChangeFile();
file.setName( f.getName() );
file.setRevision( f.getRevision() );
change.addFile( file );
}
}
result.addChange( change );
}
}
else
{
// We don't have a changes information probably because provider doesn't have a changelog command
// so we use the updated list that contains only the updated files list
ChangeSet changeSet = convertScmFileSetToChangeSet( scmResult.getUpdatedFiles() );
if ( changeSet != null )
{
result.addChange( changeSet );
}