if ( getLogger().isDebugEnabled() )
{
getLogger().debug( "Executing tag command..." );
}
JazzScmProviderRepository jazzRepo = (JazzScmProviderRepository) repo;
getLogger().debug( "Creating Snapshot..." );
StreamConsumer tagConsumer =
new DebugLoggerConsumer( getLogger() ); // No need for a dedicated consumer for this
ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );
JazzScmCommand tagCreateSnapshotCmd =
createTagCreateSnapshotCommand( jazzRepo, fileSet, tag, scmTagParameters );
int status = tagCreateSnapshotCmd.execute( tagConsumer, errConsumer );
if ( status != 0 || errConsumer.hasBeenFed() )
{
return new TagScmResult( tagCreateSnapshotCmd.getCommandString(),
"Error code for Jazz SCM tag (SNAPSHOT) command - " + status,
errConsumer.getOutput(), false );
}
// ------------------------------------------------------------------
// We create the workspace based on the tag here, as the scm tool
// can not currently check directly out from a snapshot (only a workspace).
getLogger().debug( "Creating Workspace from Snapshot..." );
JazzScmCommand tagCreateWorkspaceCmd = createTagCreateWorkspaceCommand( jazzRepo, fileSet, tag );
errConsumer = new ErrorConsumer( getLogger() );
status = tagCreateWorkspaceCmd.execute( tagConsumer, errConsumer );
if ( status != 0 || errConsumer.hasBeenFed() )
{
return new TagScmResult( tagCreateWorkspaceCmd.getCommandString(),
"Error code for Jazz SCM tag (WORKSPACE) command - " + status,
errConsumer.getOutput(), false );
}
// ------------------------------------------------------------------
if ( jazzRepo.isPushChangesAndHaveFlowTargets() )
{
// isPushChanges = true, and we have something to deliver and promote to.
getLogger().debug( "Promoting and delivering..." );
// So we deliver the code to the target stream (or workspace)