* @param lastBuildTime
* @param checkTime
* @return CommandLine for "cvs -d CVSROOT -q log -N -dlastbuildtime<checktime "
*/
public Commandline buildHistoryCommand(Date lastBuildTime, Date checkTime) throws CruiseControlException {
Commandline commandLine = new Commandline();
commandLine.setExecutable("cvs");
if (local != null) {
commandLine.setWorkingDirectory(local);
}
if (cvsroot != null) {
commandLine.createArgument().setValue("-d");
commandLine.createArgument().setValue(cvsroot);
}
commandLine.createArgument().setValue("-q");
commandLine.createArgument().setValue("log");
commandLine.createArgument().setValue("-N");
String dateRange = formatCVSDate(lastBuildTime) + "<" + formatCVSDate(checkTime);
commandLine.createArgument().setValue("-d" + dateRange);
if (tag != null) {
// add -b and -rTAG to list changes relative to the current branch,
// not relative to the default branch, which is HEAD
// note: -r cannot have a space between itself and the tag spec.
commandLine.createArgument().setValue("-r" + tag);
} else {
// This is used to include the head only if a Tag is not specified.
commandLine.createArgument().setValue("-b");
}
return commandLine;
}