use of org.apache.maven.scm.command.blame.BlameLine in project maven-scm by apache.
the class BazaarBlameConsumer method doConsume.
public void doConsume(ScmFileStatus status, String trimmedLine) {
/*1 godin@godin 20100131*/
String annotation = trimmedLine.substring(0, trimmedLine.indexOf('|')).trim();
String dateStr = annotation.substring(annotation.lastIndexOf(' ') + 1);
annotation = annotation.substring(0, annotation.lastIndexOf(' '));
String author = annotation.substring(annotation.lastIndexOf(' ') + 1);
annotation = annotation.substring(0, annotation.lastIndexOf(' '));
String revision = annotation.trim();
Date date = parseDate(dateStr, null, BAZAAR_TIMESTAMP_PATTERN);
lines.add(new BlameLine(date, revision, author));
}
use of org.apache.maven.scm.command.blame.BlameLine in project maven-scm by apache.
the class ClearCaseBlameConsumer method consumeLine.
public void consumeLine(String line) {
Matcher matcher = LINE_PATTERN.matcher(line);
if (matcher.matches()) {
String revision = matcher.group(1);
// SCM-613
String author = matcher.group(2).toLowerCase();
String dateTimeStr = matcher.group(3);
Date dateTime = parseDate(dateTimeStr, null, CLEARCASE_TIMESTAMP_PATTERN);
lines.add(new BlameLine(dateTime, revision, author));
if (getLogger().isDebugEnabled()) {
getLogger().debug(author + " " + dateTimeStr);
}
}
}
use of org.apache.maven.scm.command.blame.BlameLine in project maven-scm by apache.
the class HgBlameConsumer method doConsume.
public void doConsume(ScmFileStatus status, String trimmedLine) {
/* godin 0 Sun Jan 31 03:04:54 2010 +0300 */
String annotation;
if (trimmedLine.indexOf(": ") > -1) {
annotation = trimmedLine.substring(0, trimmedLine.indexOf(": ")).trim();
} else {
annotation = trimmedLine.substring(0, trimmedLine.lastIndexOf(":")).trim();
}
String author = annotation.substring(0, annotation.indexOf(' '));
annotation = annotation.substring(annotation.indexOf(' ') + 1).trim();
String revision = annotation.substring(0, annotation.indexOf(' '));
annotation = annotation.substring(annotation.indexOf(' ') + 1).trim();
String dateStr = annotation;
Date dateTime = parseDate(dateStr, null, HG_TIMESTAMP_PATTERN, Locale.ENGLISH);
lines.add(new BlameLine(dateTime, revision, author));
}
use of org.apache.maven.scm.command.blame.BlameLine in project maven-scm by apache.
the class ClearCaseBlameConsumerTest method testConsumer.
public void testConsumer() throws IOException {
InputStream inputStream = getResourceAsStream("/clearcase/blame/clearcase.log");
BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
String s = in.readLine();
ClearCaseBlameConsumer consumer = new ClearCaseBlameConsumer(new DefaultLog());
while (s != null) {
consumer.consumeLine(s);
s = in.readLine();
}
Assert.assertEquals(12, consumer.getLines().size());
BlameLine line1 = (BlameLine) consumer.getLines().get(0);
Assert.assertEquals("7", line1.getRevision());
Assert.assertEquals("jeremie lagarde", line1.getAuthor());
BlameLine line12 = (BlameLine) consumer.getLines().get(11);
Assert.assertEquals("5", line12.getRevision());
Assert.assertEquals("evgeny mandrikov", line12.getAuthor());
}
use of org.apache.maven.scm.command.blame.BlameLine in project maven-scm by apache.
the class HgBlameCommandTckTest method verifyResult.
protected void verifyResult(BlameScmResult result) {
List<BlameLine> lines = result.getLines();
assertEquals("Expected 1 line in blame", 1, lines.size());
BlameLine line = lines.get(0);
assertEquals("0", line.getRevision());
}
Aggregations