MPCHANGELOG-70: Fix regexp's for username with spaces + tests. Thanks to Arnaud Bailly.
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@293395 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -82,7 +82,7 @@ class SvnChangeLogParser implements ChangeLogParser
|
||||
/** The pattern used to match svn header lines */
|
||||
private static final String pattern =
|
||||
"^r(\\d+)\\s+\\|\\s+" + // revision number
|
||||
"(\\(\\S+\\s+\\S+\\)|\\S+)\\s+\\|\\s+" + // author username
|
||||
"([^|]+)\\|\\s+" + // author username
|
||||
"(\\d+-\\d+-\\d+ " + // date 2002-08-24
|
||||
"\\d+:\\d+:\\d+) " + // time 16:01:00
|
||||
"([\\-+])(\\d\\d)(\\d\\d)"; // gmt offset -0400
|
||||
@@ -198,7 +198,8 @@ class SvnChangeLogParser implements ChangeLogParser
|
||||
|
||||
currentRevision = headerRegexp.getParen(1);
|
||||
currentLogEntry = new ChangeLogEntry();
|
||||
currentLogEntry.setAuthor(headerRegexp.getParen(2));
|
||||
/* set author to be trimmed author field */
|
||||
currentLogEntry.setAuthor(headerRegexp.getParen(2).trim());
|
||||
currentLogEntry.setDate(parseDate());
|
||||
|
||||
status = GET_FILE;
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
------------------------------------------------------------------------
|
||||
r15 | kaz | 2002-08-26 14:33:26 -0400 (Mon, 26 Aug 2002) | 3 lines
|
||||
r16 | kaz | 2002-08-26 20:33:26 -0400 (Mon, 26 Aug 2002) | 3 lines
|
||||
Changed paths:
|
||||
M /poolserver/trunk/build.xml
|
||||
M /poolserver/trunk/project.properties
|
||||
|
||||
Minor formatting changes.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
r15 | kaz toto | 2002-08-26 10:24:58 -0400 (Mon, 26 Aug 2002) | 3 lines
|
||||
Changed paths:
|
||||
M /poolserver/trunk/build.xml
|
||||
|
||||
Added white space to test author parsing.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
r14 | kaz | 2002-08-26 10:24:58 -0400 (Mon, 26 Aug 2002) | 3 lines
|
||||
Changed paths:
|
||||
|
||||
@@ -77,18 +77,22 @@ public class SvnChangeLogParserTest extends TestCase
|
||||
FileInputStream fis = new FileInputStream(testFile);
|
||||
List entries = new ArrayList(parser.parse(fis));
|
||||
|
||||
assertEquals("Wrong number of entries returned", 13, entries.size());
|
||||
assertEquals("Wrong number of entries returned", 14, entries.size());
|
||||
|
||||
ChangeLogEntry entry = (ChangeLogEntry) entries.get(0);
|
||||
assertEquals("Entry 0 was parsed incorrectly",
|
||||
"kaz\n" +
|
||||
DATE.parse("Mon Aug 26 14:33:26 EDT 2002") + "\n" +
|
||||
"[/poolserver/trunk/build.xml, 15, " +
|
||||
"/poolserver/trunk/project.properties, 15]\n" +
|
||||
DATE.parse("Mon Aug 26 20:33:26 EDT 2002") + "\n" +
|
||||
"[/poolserver/trunk/build.xml, 16, " +
|
||||
"/poolserver/trunk/project.properties, 16]\n" +
|
||||
"Minor formatting changes.\n\n",
|
||||
entry.toString());
|
||||
/* check author with space was parsed correctly */
|
||||
entry = (ChangeLogEntry) entries.get(1);
|
||||
assertEquals("Entry 0 was parsed incorrectly",
|
||||
"kaz toto",entry.getAuthor());
|
||||
|
||||
entry = (ChangeLogEntry) entries.get(6);
|
||||
entry = (ChangeLogEntry) entries.get(7);
|
||||
assertEquals("Entry 6 was parsed incorrectly",
|
||||
"(no author)\n" +
|
||||
DATE.parse("Fri Aug 23 11:11:52 EDT 2002") + "\n" +
|
||||
@@ -96,7 +100,7 @@ public class SvnChangeLogParserTest extends TestCase
|
||||
"Testing script out again ...\n\n",
|
||||
entry.toString());
|
||||
|
||||
entry = (ChangeLogEntry) entries.get(8);
|
||||
entry = (ChangeLogEntry) entries.get(9);
|
||||
assertEquals("Entry 8 was parsed incorrectly",
|
||||
"pete\n" +
|
||||
DATE.parse("Fri Aug 23 11:03:39 EDT 2002") + "\n" +
|
||||
@@ -105,7 +109,7 @@ public class SvnChangeLogParserTest extends TestCase
|
||||
"subversion).\n\n",
|
||||
entry.toString());
|
||||
|
||||
entry = (ChangeLogEntry) entries.get(12);
|
||||
entry = (ChangeLogEntry) entries.get(13);
|
||||
assertEquals("Entry 12 was parsed incorrectly",
|
||||
"DOMAIN\\user\n" +
|
||||
DATE.parse("Wed Aug 21 00:20:25 EDT 2002") + "\n" +
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
<author email="evenisse@ifrance.com">Emmanuel Venisse</author>
|
||||
</properties>
|
||||
<body>
|
||||
<release version="1.9-SNAPSHOT" date="in SVN">
|
||||
<action dev="ltheussl" type="fix" issue="MPCHANGELOG-70" due-to="Arnaud Bailly">Incorrect parsing of SVN log files when username contains spaces.</action>
|
||||
</release>
|
||||
<release version="1.8.2" date="2005-06-15">
|
||||
<action dev="brett" type="fix" issue="MPCHANGELOG-66">Avoid NullPointerException when no type is given</action>
|
||||
<action dev="brett" type="fix" issue="MPCHANGELOG-65" due-to="Fuad Efendi">Corrected parsing of VSS results</action>
|
||||
|
||||
Reference in New Issue
Block a user