}
public static Commandline getBaseCommand( String commandName, CvsScmProviderRepository repo, ScmFileSet fileSet,
String options, boolean addCvsRoot )
{
Settings settings = CvsUtil.getSettings();
Commandline cl = new Commandline();
cl.setExecutable( "cvs" );
cl.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() );
if ( Boolean.getBoolean( "maven.scm.cvs.use_compression" ) )
{
cl.createArg().setValue( "-z" + System.getProperty( "maven.scm.cvs.compression_level", "3" ) );
}
else if ( settings.getCompressionLevel() > 0 )
{
cl.createArg().setValue( "-z" + settings.getCompressionLevel() );
}
if ( !settings.isUseCvsrc() )
{
cl.createArg().setValue( "-f" ); // don't use ~/.cvsrc
}
if ( settings.isTraceCvsCommand() )
{
cl.createArg().setValue( "-t" );
}
if ( !StringUtils.isEmpty( settings.getTemporaryFilesDirectory() ) )
{
File tempDir = new File( settings.getTemporaryFilesDirectory() );
if ( !tempDir.exists() )
{
tempDir.mkdirs();
}
cl.createArg().setValue( "-T" );
cl.createArg().setValue( tempDir.getAbsolutePath() );
}
if ( settings.getCvsVariables().size() > 0 )
{
for ( Enumeration<?> e = settings.getCvsVariables().propertyNames(); e.hasMoreElements(); )
{
String key = (String) e.nextElement();
String value = settings.getCvsVariables().getProperty( key );
cl.createArg().setValue( "-s" );
cl.createArg().setValue( key + "=" + value );
}
}