throws ScmException
{
// Call the Add command to perform the checkin into the repository workspace.
JazzAddCommand addCommand = new JazzAddCommand();
addCommand.setLogger( getLogger() );
AddScmResult addResult = addCommand.executeAddCommand( repo, fileSet );
// Now, if it has a flow target, deliver it.
JazzScmProviderRepository jazzRepo = (JazzScmProviderRepository) repo;
if ( jazzRepo.isPushChangesAndHaveFlowTargets() )
{
// Push if we need too
JazzScmCommand deliverCmd = createDeliverCommand( (JazzScmProviderRepository) repo, fileSet );
StreamConsumer deliverConsumer =
new DebugLoggerConsumer( getLogger() ); // No need for a dedicated consumer for this
ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );
int status = deliverCmd.execute( deliverConsumer, errConsumer );
if ( status != 0 || errConsumer.hasBeenFed() )
{
return new CheckInScmResult( deliverCmd.getCommandString(),
"Error code for Jazz SCM deliver command - " + status,
errConsumer.getOutput(), false );
}
}
// Return what was added.
return new CheckInScmResult( addResult.getCommandLine(), addResult.getAddedFiles() );
}