{
ReleaseResult relResult = new ReleaseResult();
validateConfiguration( releaseDescriptor );
ReleaseDescriptor basedirAlignedReleaseDescriptor =
ReleaseUtil.createBasedirAlignedReleaseDescriptor( releaseDescriptor, reactorProjects );
logInfo( relResult, "Branching release with the label " + basedirAlignedReleaseDescriptor.getScmReleaseLabel()
+ "..." );
ScmRepository repository;
ScmProvider provider;
try
{
repository =
scmRepositoryConfigurator.getConfiguredRepository( basedirAlignedReleaseDescriptor.getScmSourceUrl(),
releaseDescriptor, releaseEnvironment.getSettings() );
repository.getProviderRepository().setPushChanges( releaseDescriptor.isPushChanges() );
provider = scmRepositoryConfigurator.getRepositoryProvider( repository );
}
catch ( ScmRepositoryException e )
{
throw new ReleaseScmRepositoryException( e.getMessage(), e.getValidationMessages() );
}
catch ( NoSuchScmProviderException e )
{
throw new ReleaseExecutionException( "Unable to configure SCM repository: " + e.getMessage(), e );
}
BranchScmResult result;
try
{
ScmFileSet fileSet = new ScmFileSet( new File( basedirAlignedReleaseDescriptor.getWorkingDirectory() ) );
String branchName = releaseDescriptor.getScmReleaseLabel();
ScmBranchParameters scmBranchParameters = new ScmBranchParameters();
scmBranchParameters.setMessage( releaseDescriptor.getScmCommentPrefix() + "copy for branch " + branchName );
scmBranchParameters.setRemoteBranching( releaseDescriptor.isRemoteTagging() );