@Override
public BranchScmResult executeBranchCommand( ScmProviderRepository repository, ScmFileSet fileSet,
String branchName, String message )
throws ScmException
{
BranchScmResult result;
IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
Project siProject = iRepo.getProject();
getLogger().info(
"Attempting to branch project " + siProject.getProjectName() + " using branch name '" + branchName + "'" );
try
{
Project.validateTag( branchName );
Response res = siProject.createDevPath( branchName );
int exitCode = res.getExitCode();
boolean success = ( exitCode == 0 ? true : false );
ScmResult scmResult = new ScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
result = new BranchScmResult( new ArrayList<ScmFile>(), scmResult );
}
catch ( APIException aex )
{
ExceptionHandler eh = new ExceptionHandler( aex );
getLogger().error( "MKS API Exception: " + eh.getMessage() );
getLogger().info( eh.getCommand() + " exited with return code " + eh.getExitCode() );
result = new BranchScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
}
catch ( Exception e )
{
getLogger().error( "Failed to checkpoint project! " + e.getMessage() );
result = new BranchScmResult( "si createdevpath", e.getMessage(), "", false );
}
return result;
}