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