in maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/changelog/HgChangeLogConsumer.java [85:127]
public void doConsume(ScmFileStatus status, String line) {
String tmpLine;
// new changeset
if (line.startsWith(REVNO_TAG)) {
// Init a new changeset
currentChange = new ChangeSet();
currentChange.setFiles(new ArrayList<>(0));
logEntries.add(currentChange);
// parse revision
tmpLine = line.substring(REVNO_TAG.length()).trim();
currentRevision = tmpLine.substring(tmpLine.indexOf(':') + 1);
currentChange.setRevision(currentRevision);
} else if (line.startsWith(BRANCH_TAG)) {
tmpLine = line.substring(BRANCH_TAG.length()).trim();
currentBranch = tmpLine;
} else if (line.startsWith(AUTHOR_TAG)) {
tmpLine = line.substring(AUTHOR_TAG.length()).trim();
currentChange.setAuthor(tmpLine);
} else if (line.startsWith(TIME_STAMP_TOKEN)) {
tmpLine = line.substring(TIME_STAMP_TOKEN.length()).trim();
Date date = parseDate(tmpLine, userDatePattern, TIME_PATTERN, Locale.ENGLISH);
currentChange.setDate(date);
} else if (line.startsWith(TAG_TAG)) {
tmpLine = line.substring(TAG_TAG.length()).trim();
currentChange.addTag(tmpLine);
} else if (line.startsWith(FILES_TOKEN)) {
tmpLine = line.substring(FILES_TOKEN.length()).trim();
String[] files = tmpLine.split(" ");
for (int i = 0; i < files.length; i++) {
String file = files[i];
ChangeFile changeFile = new ChangeFile(file, currentRevision);
currentChange.addFile(changeFile);
}
} else if (line.startsWith(MESSAGE_TOKEN)) {
currentChange.setComment("");
} else {
StringBuilder comment = new StringBuilder(currentChange.getComment());
comment.append(line);
currentChange.setComment(comment.toString());
}
}