* @throws ScmRepositoryException
*/
private ScmRepository getScmRepository( ContinuumScmConfiguration configuration )
throws ScmRepositoryException, NoSuchScmProviderException
{
ScmRepository repository = scmManager.makeScmRepository( configuration.getUrl() );
// TODO: tie together with the clientspec change below
// This checkout will be retained between uses, so it remains connected to the repository
repository.getProviderRepository().setPersistCheckout( true );
// TODO: should this be svnexe?
if ( !configuration.isUseCredentialsCache() || !"svn".equals( repository.getProvider() ) )
{
if ( !StringUtils.isEmpty( configuration.getUsername() ) )
{
repository.getProviderRepository().setUser( configuration.getUsername() );
if ( !StringUtils.isEmpty( configuration.getPassword() ) )
{
repository.getProviderRepository().setPassword( configuration.getPassword() );
}
else
{
repository.getProviderRepository().setPassword( "" );
}
}
}
if ( "perforce".equals( repository.getProvider() ) )
{
// TODO: remove the use of system property - need a better way to pass provider specific configuration
// Remove the clientspec name, so it will be recalculated between each command for each project
// instead of use the same for all projects