StatusScmResult statusCmdResult = statusCmd.executeStatusCommand( repo, fileSet );
List<ScmFile> statusScmFiles = statusCmdResult.getChangedFiles();
for ( Iterator<ScmFile> it = statusScmFiles.iterator(); it.hasNext(); )
{
ScmFile file = (ScmFile) it.next();
getLogger().debug( "Iterating over statusScmFiles: " + file );
if ( file.getStatus() == ScmFileStatus.ADDED ||
file.getStatus() == ScmFileStatus.DELETED ||
file.getStatus() == ScmFileStatus.MODIFIED )
{
changedScmFiles.add( new ScmFile( file.getPath(), ScmFileStatus.CHECKED_IN ) );
changedFiles.add( new File( parentFolder, file.getPath() ) );
}
}
List<File> files = fileSet.getFileList();
if ( files.size() == 0 )
{
// Either commit all local changes
commitedFiles = changedScmFiles;
}
else
{
// Or commit specific files
for ( int i = 0; i < files.size(); i++ )
{
if ( fileExistsInFileList( (File) ( files.get( i ) ), changedFiles ) )
{
commitedFiles.add( new ScmFile( ( (File) files.get( i ) ).getPath(), ScmFileStatus.CHECKED_IN ) );
}
}
}
// Now that we have a list of files to process, we can "add" (scm checkin) them.