* {@inheritDoc}
*/
protected BlameScmResult executeCvsCommand( Commandline cl, CvsScmProviderRepository repository )
{
CvsLogListener logListener = new CvsLogListener();
CvsBlameConsumer consumer = new CvsBlameConsumer( getLogger() );
try
{
boolean isSuccess =
CvsConnection.processCommand( cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(),
logListener, getLogger() );
if ( !isSuccess )
{
return new BlameScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(),
false );
}
BufferedReader stream = new BufferedReader(
new InputStreamReader( new ByteArrayInputStream( logListener.getStdout().toString().getBytes() ) ) );
String line;
while ( ( line = stream.readLine() ) != null )
{
consumer.consumeLine( line );
}
}
catch ( Exception e )
{
getLogger().error( e );
return new BlameScmResult( cl.toString(), "The cvs command failed.", logListener.getStdout().toString(),
false );
}
return new BlameScmResult( cl.toString(), consumer.getLines() );
}