// First validate the checkpoint label string by evaluating the groovy script
String chkptLabel = evalGroovyExpression( tagName );
Project.validateTag( chkptLabel );
String msg = ( ( null == message || message.length() == 0 ) ? System.getProperty( "message" ) : message );
// Get information about the Project
Project siProject = iRepo.getProject();
// Ensure this is not a build project configuration
if ( !siProject.isBuild() )
{
Response res = siProject.checkpoint( msg, chkptLabel );
int exitCode = res.getExitCode();
boolean success = ( exitCode == 0 ? true : false );
WorkItem wi = res.getWorkItem( siProject.getConfigurationPath() );
String chkpt = wi.getResult().getField( "resultant" ).getItem().getId();
getLogger().info(
"Successfully checkpointed project " + siProject.getConfigurationPath() + " with label '"
+ chkptLabel + "', new revision is " + chkpt );
result =
new TagScmResult( res.getCommandString(), wi.getResult().getMessage(), "Exit Code: " + exitCode,
success );
}
else
{
getLogger().error(
"Cannot checkpoint a build project configuration: " + siProject.getConfigurationPath() + "!" );
result =
new TagScmResult( "si checkpoint", "Cannot checkpoint a build project configuration!", "", false );
}
}
catch ( CompilationFailedException cfe )