ScmVersion startVersion, ScmVersion endVersion, String datePattern )
throws ScmException
{
CvsLogListener logListener = new CvsLogListener();
CvsChangeLogConsumer consumer = new CvsChangeLogConsumer( getLogger(), datePattern );
try
{
boolean isSuccess = CvsConnection.processCommand( cl.getArguments(),
cl.getWorkingDirectory().getAbsolutePath(), logListener,
getLogger() );
if ( !isSuccess )
{
return new ChangeLogScmResult( 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 )
{
e.printStackTrace();
return new ChangeLogScmResult( cl.toString(), "The cvs command failed.", logListener.getStdout().toString(),
false );
}
ChangeLogSet changeLogSet = new ChangeLogSet( consumer.getModifications(), startDate, endDate );
changeLogSet.setStartVersion( startVersion );
changeLogSet.setEndVersion( endVersion );
return new ChangeLogScmResult( cl.toString(), changeLogSet );
}