protected TagScmResult executeCvsCommand( Commandline cl )
throws ScmException
{
CvsLogListener logListener = new CvsLogListener();
CvsTagConsumer consumer = new CvsTagConsumer( getLogger() );
try
{
boolean isSuccess = CvsConnection.processCommand( cl.getArguments(),
cl.getWorkingDirectory().getAbsolutePath(), logListener,
getLogger() );
if ( !isSuccess )
{
return new TagScmResult( cl.toString(), "The cvs tag 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 )
{
e.printStackTrace();
return new TagScmResult( cl.toString(), "The cvs tag command failed.", logListener.getStderr().toString(),
false );
}
return new TagScmResult( cl.toString(), consumer.getTaggedFiles() );
}