dion 02/04/15 08:56:04
Modified: src/java/org/apache/maven/cvslib ChangeLogParser.java
Log:
Fixed bu bug where changes were being missed
Revision Changes Path
1.12 +15 -6
jakarta-turbine-maven/src/java/org/apache/maven/cvslib/ChangeLogParser.java
Index: ChangeLogParser.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/cvslib/ChangeLogParser.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ChangeLogParser.java 15 Apr 2002 02:14:37 -0000 1.11
+++ ChangeLogParser.java 15 Apr 2002 15:56:04 -0000 1.12
@@ -67,7 +67,7 @@
* A class to parse cvs log output
*
* @author <a href="mailto:[EMAIL PROTECTED]">dIon Gillard</a>
- * @version $Id: ChangeLogParser.java,v 1.11 2002/04/15 02:14:37 dion Exp $
+ * @version $Id: ChangeLogParser.java,v 1.12 2002/04/15 15:56:04 dion Exp $
*/
public class ChangeLogParser
{
@@ -91,9 +91,9 @@
/** Marks start of file data*/
private static final String START_FILE = "Working file: ";
/** Marks end of file */
- private static final String END_FILE = "======";
+ private static final String END_FILE
="=============================================================================";
/** Marks start of revision */
- private static final String START_REVISION = "------";
+ private static final String START_REVISION = "----------------------------";
/** Marks revision data */
private static final String REVISION_TAG = "revision ";
/** Marks date data */
@@ -164,11 +164,15 @@
* Add a change log entry to the list (if it's not already there)
* with the given file.
* @param entry a {@link ChangeLogEntry} to be added to the list if another
- * with the same key doesn't exist already
+ * with the same key doesn't exist already. If the entry's author
+ * is null, the entry wont be added
* @param file a {@link ChangeLogFile} to be added to the entry
*/
private void addEntry(ChangeLogEntry entry, ChangeLogFile file)
{
+ // do not add if entry is not populated
+ if (entry.getAuthor() == null) return;
+
String key = entry.getDateFormatted() + entry.getAuthor() +
entry.getComment();
if (!entries.containsKey(key))
@@ -211,7 +215,9 @@
{
// If we encounter an end of file line, it means there
// are no more revisions for the current file.
+ // there could also be a file still being processed.
setStatus(GET_FILE);
+ addEntry(getCurrentLogEntry(), getCurrentFile());
}
}
@@ -237,10 +243,13 @@
*/
private void processGetComment(String line)
{
- if (line.startsWith(END_FILE) ||
- (line.startsWith(START_REVISION)))
+ if (line.startsWith(START_REVISION))
{
setStatus(GET_PREVIOUS_REV);
+ }
+ else if (line.startsWith(END_FILE))
+ {
+ addEntry(getCurrentLogEntry(), getCurrentFile());
}
else
{