* Parse individual VSS history entry
*
*@param historyEntry
*/
protected Modification handleEntry(List historyEntry) {
Modification mod = new Modification("vss");
String nameAndDateLine = (String) historyEntry.get(2);
mod.userName = parseUser(nameAndDateLine);
mod.modifiedTime = parseDate(nameAndDateLine);
String folderLine = (String) historyEntry.get(0);
String fileLine = (String) historyEntry.get(3);
if (!isInSsDir(folderLine)) {
// We are only interested in modifications to files in the specified ssdir
return null;
} else if (isBeforeLastBuild(mod.modifiedTime)) {
// We are only interested in modifications since the last build
return null;
} else if (fileLine.startsWith("Labeled")) {
// We don't add labels.
return null;
} else if (fileLine.startsWith("Checked in")) {
String fileName = substringFromLastSlash(folderLine);
String folderName = substringToLastSlash(folderLine);
Modification.ModifiedFile modfile = mod.createModifiedFile(fileName, folderName);
modfile.action = "checkin";
mod.comment = parseComment(historyEntry);
} else if (fileLine.indexOf(" renamed to ") > -1) {
// TODO: This is a special case that is really two modifications: deleted and recovered.
// For now I'll consider it a deleted to force a clean build.
// I should really make this two modifications.
mod.comment = parseComment(historyEntry);
String fileName = fileLine.substring(0, fileLine.indexOf(" "));
String folderName = folderLine;
Modification.ModifiedFile modfile = mod.createModifiedFile(fileName, folderName);
modfile.action = "delete";
} else if (fileLine.indexOf(" moved to ") > -1) {
// TODO: This is a special case that is really two modifications: deleted and recovered.
// For now I'll consider it a deleted to force a clean build.
// I should really make this two modifications.
mod.comment = parseComment(historyEntry);
String fileName = fileLine.substring(0, fileLine.indexOf(" "));
String folderName = folderLine;
Modification.ModifiedFile modfile = mod.createModifiedFile(fileName, folderName);
modfile.action = "delete";
} else {
String folderName = folderLine;
String fileName = fileLine.substring(0, fileLine.lastIndexOf(" "));
Modification.ModifiedFile modfile = mod.createModifiedFile(fileName, folderName);
mod.comment = parseComment(historyEntry);
if (fileLine.endsWith("added")) {
modfile.action = "add";