* For example:
*
* 'svn log --non-interactive --xml -v -r {lastbuildTime}:headRevision repositoryLocation'
*/
Commandline buildHistoryCommand(Date lastBuild, String headRevision) throws CruiseControlException {
Commandline command = new Commandline();
command.setExecutable("svn");
if (localWorkingCopy != null) {
command.setWorkingDirectory(localWorkingCopy);
}
command.createArgument().setValue("log");
command.createArgument().setValue("--non-interactive");
command.createArgument().setValue("--xml");
command.createArgument().setValue("-v");
command.createArgument().setValue("-r");
if (lastBuild == null) {
command.createArgument().setValue("HEAD:COMMITTED");
} else {
command.createArgument().setValue(
"{" + SVN_DATE_FORMAT_IN.format(lastBuild) + "}" + ":" + headRevision);
}
if (userName != null) {
command.createArgument().setValue("--username");
command.createArgument().setValue(userName);
}
if (password != null) {
command.createArgument().setValue("--password");
command.createArgument().setValue(password);
}
if (repositoryLocation != null) {
command.createArgument().setValue(repositoryLocation);
}
LOG.debug("Executing command: " + command);
return command;