ScmVersion endVersion, String datePattern )
throws ScmException
{
CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
Commandline cl = CvsCommandUtils.getBaseCommand( "log", repository, fileSet );
if ( startDate != null )
{
SimpleDateFormat outputDate = new SimpleDateFormat( getDateFormat() );
String dateRange;
if ( endDate == null )
{
dateRange = ">" + outputDate.format( startDate );
}
else
{
dateRange = outputDate.format( startDate ) + "<" + outputDate.format( endDate );
}
cl.createArg().setValue( "-d" );
addDateRangeParameter( cl, dateRange );
}
if ( branch != null && StringUtils.isNotEmpty( branch.getName() ) )
{
cl.createArg().setValue( "-r" + branch.getName() );
}
if ( startVersion != null || endVersion != null )
{
StringBuilder sb = new StringBuilder();
sb.append( "-r" );
if ( startVersion != null && StringUtils.isNotEmpty( startVersion.getName() ) )
{
sb.append( startVersion.getName() );
}
sb.append( "::" );
if ( endVersion != null && StringUtils.isNotEmpty( endVersion.getName() ) )
{
sb.append( endVersion.getName() );
}
cl.createArg().setValue( sb.toString() );
}
if ( getLogger().isInfoEnabled() )
{
getLogger().info( "Executing: " + cl );
getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() );
}
return executeCvsCommand( cl, startDate, endDate, startVersion, endVersion, datePattern );
}