maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r520471 - /maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.java
Date Tue, 20 Mar 2007 16:44:48 GMT
Author: evenisse
Date: Tue Mar 20 09:44:48 2007
New Revision: 520471

URL: http://svn.apache.org/viewvc?view=rev&rev=520471
Log:
Fix cvs log parsing for date/username

Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.java

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.java?view=diff&rev=520471&r1=520470&r2=520471
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.java
Tue Mar 20 09:44:48 2007
@@ -211,15 +211,20 @@
     {
         if ( line.startsWith( DATE_TAG ) )
         {
-            StringTokenizer tokenizer = new StringTokenizer( line, " ;" );
-            // date: YYYY/mm/dd HH:mm:ss; author: name
-            tokenizer.nextToken(); // date tag
-            String date = tokenizer.nextToken();
-            String time = tokenizer.nextToken();
-            getCurrentChange().setDate( date + " " + time + " UTC", userDatePattern );
-            tokenizer.nextToken(); // author tag
-            // assumes author can't contain spaces
-            String author = tokenizer.nextToken();
+            StringTokenizer tokenizer = new StringTokenizer( line, ";" );
+            // date: YYYY/mm/dd HH:mm:ss [Z]; author: name;...
+
+            String datePart = tokenizer.nextToken().trim();
+            String dateTime = datePart.substring( "date: ".length() );
+            StringTokenizer dateTokenizer = new StringTokenizer( dateTime, " " );
+            if ( dateTokenizer.countTokens() == 2 )
+            {
+                dateTime += " UTC";
+            }
+            getCurrentChange().setDate( dateTime, userDatePattern );
+
+            String authorPart = tokenizer.nextToken().trim();
+            String author = authorPart.substring( "author: ".length() );
             getCurrentChange().setAuthor( author );
             setStatus( GET_COMMENT );
         }



Mime
View raw message