{
FileUtils.fileWrite( messageFile.getAbsolutePath(), message );
}
catch ( IOException ex )
{
return new CheckInScmResult( null, "Error while making a temporary file for the commit message: "
+ ex.getMessage(), null, false );
}
Commandline cl = createCommandLine( (SvnScmProviderRepository) repo, fileSet, messageFile );
SvnCheckInConsumer consumer = new SvnCheckInConsumer( getLogger(), fileSet.getBasedir() );
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
if ( getLogger().isInfoEnabled() )
{
getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) );
getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() );
}
int exitCode;
try
{
exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() );
}
catch ( CommandLineException ex )
{
throw new ScmException( "Error while executing command.", ex );
}
finally
{
try
{
FileUtils.forceDelete( messageFile );
}
catch ( IOException ex )
{
// ignore
}
}
if ( exitCode != 0 )
{
return new CheckInScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false );
}
return new CheckInScmResult( cl.toString(), consumer.getCheckedInFiles(), Integer.toString( consumer.getRevision() ) );
}