maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r189558 - in /maven/scm/trunk: ./ maven-scm-api/ maven-scm-api/src/main/java/org/apache/maven/scm/ maven-scm-api/src/main/java/org/apache/maven/scm/command/ maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ maven-scm-api/src/main/java/org/apache/maven/scm/command/update/ maven-scm-api/src/main/java/org/apache/maven/scm/manager/ maven-scm-api/src/test/java/org/apache/maven/scm/ maven-scm-api/src/test/java/org/apache/maven/scm/command/changelog/ maven-scm-providers/ maven-scm-providers/maven-scm-provider-clearcase/ maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ maven-scm-providers/maven-scm-provider-cvs/ maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/ maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/ maven-scm-providers/maven-scm-provider-perforce/ maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/changelog/ maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/changelog/ maven-scm-providers/maven-scm-provider-starteam/ maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/changelog/ maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/changelog/ maven-scm-providers/maven-scm-provider-svn/ maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/ maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/ maven-scm-test/
Date Wed, 08 Jun 2005 08:37:35 GMT
Author: evenisse
Date: Wed Jun  8 01:37:34 2005
New Revision: 189558

URL: http://svn.apache.org/viewcvs?rev=189558&view=rev
Log:
Refactoring of changes list use by changelog :
- use now ChangeSet and ChangeFile instead of ChangeLogEntry and ChangeLogFile.
- move this class in org.apache.maven.scm for shared with other commands.
- The modifications list contains now a list of ChangeSet without sorting or grouping. Sorting and grouping will be the work of a ChangeSorter.

Added:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeFile.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java
    maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeFileTest.java
    maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeSetTest.java
Removed:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogEntry.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogFile.java
    maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/command/changelog/ChangeLogEntryTest.java
    maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/command/changelog/ChangeLogFileTest.java
Modified:
    maven/scm/trunk/maven-scm-api/pom.xml
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/AbstractCommand.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumerTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogConsumerTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumerTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommandTest.java
    maven/scm/trunk/maven-scm-providers/pom.xml
    maven/scm/trunk/maven-scm-test/pom.xml
    maven/scm/trunk/pom.xml

Modified: maven/scm/trunk/maven-scm-api/pom.xml
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/pom.xml?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/pom.xml (original)
+++ maven/scm/trunk/maven-scm-api/pom.xml Wed Jun  8 01:37:34 2005
@@ -3,7 +3,7 @@
   <parent>
     <groupId>org.apache.maven.scm</groupId>
     <artifactId>maven-scm</artifactId>
-    <version>1.0-alpha-1</version>
+    <version>1.0-alpha-2-SNAPSHOT</version>
   </parent>
   <artifactId>maven-scm-api</artifactId>
   <name>Maven SCM API</name>

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeFile.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeFile.java?rev=189558&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeFile.java (added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeFile.java Wed Jun  8 01:37:34 2005
@@ -0,0 +1,115 @@
+package org.apache.maven.scm;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * A set of information about revisions of a file as returned by CVS's log
+ * command
+ *
+ * @author <a href="mailto:dion@multitask.com.au">dIon Gillard </a>
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ *
+ * @version $Id: ChangeLogFile.java 162172 2004-10-26 12:37:06Z trygvis $
+ */
+public class ChangeFile
+{
+    /** the name of the file relative to the project directory. */
+    private String name;
+
+    /** the latest revision of the file. */
+    private String revision;
+
+    /**
+     * Constructor for the ChangeFile object without all details available
+     *
+     * @param name file name
+     */
+    public ChangeFile( String name )
+    {
+        setName( name );
+    }
+
+    /**
+     * Constructor for the ChangeFile object
+     *
+     * @param name file name
+     * @param rev latest revision of the file
+     */
+    public ChangeFile( String name, String rev )
+    {
+        setName( name );
+
+        setRevision( rev );
+    }
+
+    /**
+     * Gets the name attribute of the ChangeLogFile object.
+     *
+     * @return the file name
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * Gets the revision attribute of the ChangeLogFile object.
+     *
+     * @return the latest revision of the file
+     */
+    public String getRevision()
+    {
+        return revision;
+    }
+
+    /**
+     * Setter for property name.
+     *
+     * @param name New value of property name.
+     */
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+    /**
+     * Setter for property revision.
+     *
+     * @param revision New value of property revision.
+     */
+    public void setRevision( String revision )
+    {
+        this.revision = revision;
+    }
+
+    /**
+     * Provide a version of the object as a string for debugging purposes
+     *
+     * @return a {@link String}made up of the properties of the object
+     */
+    public String toString()
+    {
+        StringBuffer buffer = new StringBuffer( getName() );
+
+        if ( getRevision() != null )
+        {
+            buffer.append( ", " ).append( getRevision() );
+        }
+
+        return buffer.toString();
+    }
+}

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java?rev=189558&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java (added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java Wed Jun  8 01:37:34 2005
@@ -0,0 +1,203 @@
+package org.apache.maven.scm;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ *
+ * @version $Id: ChangeLogFile.java 162172 2004-10-26 12:37:06Z trygvis $
+ */
+public class ChangeSet
+{
+    /**
+     * Formatter used by the getDateFormatted method.
+     */
+    private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat( "yyyy-MM-dd" );
+
+    /**
+     * Formatter used by the getTimeFormatted method.
+     */
+    private static final SimpleDateFormat TIME_FORMAT = new SimpleDateFormat( "HH:mm:ss" );
+
+    /**
+     * Formatter used to parse date/timestamp.
+     */
+    private static final SimpleDateFormat TIMESTAMP_FORMAT_1 = new SimpleDateFormat( "yyyy/MM/dd HH:mm:ss" );
+
+    private static final SimpleDateFormat TIMESTAMP_FORMAT_2 = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
+
+    /** Date the changes were committed */
+    private Date date;
+
+    /** User who made changes */
+    private String author;
+
+    /** comment provided at commit time */
+    private String comment = "";
+
+    private ChangeFile file;
+
+    public ChangeSet( String date, String comment, String author, ChangeFile file )
+    {
+        setDate( date );
+
+        setAuthor( author );
+
+        setComment( comment );
+
+        this.file = file;
+    }
+
+    /**
+     * Constructor used when attributes aren't available until later
+     */
+    public ChangeSet()
+    {
+    }
+
+    /**
+     * Getter for property file.
+     *
+     * @return Value of property file.
+     */
+    public ChangeFile getFile()
+    {
+        return file;
+    }
+
+    /**
+     * Setter for property file.
+     *
+     * @param author New value of property file.
+     */
+    public void setFile( ChangeFile file )
+    {
+        this.file = file;
+    }
+
+    /**
+     * Getter for property author.
+     *
+     * @return Value of property author.
+     */
+    public String getAuthor()
+    {
+        return author;
+    }
+
+    /**
+     * Setter for property author.
+     *
+     * @param author New value of property author.
+     */
+    public void setAuthor( String author )
+    {
+        this.author = author;
+    }
+
+    /**
+     * Getter for property comment.
+     *
+     * @return Value of property comment.
+     */
+    public String getComment()
+    {
+        return comment;
+    }
+
+    /**
+     * Setter for property comment.
+     *
+     * @param comment New value of property comment.
+     */
+    public void setComment( String comment )
+    {
+        this.comment = comment;
+    }
+
+    /**
+     * Getter for property date.
+     *
+     * @return Value of property date.
+     */
+    public Date getDate()
+    {
+        return (Date) date.clone();
+    }
+
+    /**
+     * Setter for property date.
+     *
+     * @param date New value of property date.
+     */
+    public void setDate( Date date )
+    {
+        this.date = new Date( date.getTime() );
+    }
+
+    /**
+     * Setter for property date that takes a string and parses it
+     *
+     * @param date - a string in yyyy/MM/dd HH:mm:ss format
+     */
+    public void setDate( String date )
+    {
+        try
+        {
+            this.date = TIMESTAMP_FORMAT_1.parse( date );
+        }
+        catch ( ParseException e )
+        {
+            try
+            {
+                this.date = TIMESTAMP_FORMAT_2.parse( date );
+            }
+            catch ( ParseException ex )
+            {
+                throw new IllegalArgumentException( "Unable to parse CVS date: " + date );
+            }
+        }
+    }
+
+    /**
+     * @return date in yyyy-mm-dd format
+     */
+    public synchronized String getDateFormatted()
+    {
+        return DATE_FORMAT.format( getDate() );
+    }
+
+    /**
+     * @return time in HH:mm:ss format
+     */
+    public synchronized String getTimeFormatted()
+    {
+        return TIME_FORMAT.format( getDate() );
+    }
+
+    /**
+     * @return Returns string representation of the changeset
+     */
+    public String toString()
+    {
+        return author + "\n" + date + "\n" + file + "\n" + comment;
+    }
+}

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/AbstractCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/AbstractCommand.java?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/AbstractCommand.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/AbstractCommand.java Wed Jun  8 01:37:34 2005
@@ -1,7 +1,7 @@
 package org.apache.maven.scm.command;
 
 /*
- * Copyright 2001-2004 The Apache Software Foundation.
+ * Copyright 2001-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java Wed Jun  8 01:37:34 2005
@@ -1,7 +1,7 @@
 package org.apache.maven.scm.command.update;
 
 /*
- * Copyright 2001-2004 The Apache Software Foundation.
+ * Copyright 2001-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java Wed Jun  8 01:37:34 2005
@@ -64,7 +64,6 @@
     // ----------------------------------------------------------------------
 
     public void initialize()
-        throws Exception
     {
         if ( scmProviders == null )
         {

Added: maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeFileTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeFileTest.java?rev=189558&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeFileTest.java (added)
+++ maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeFileTest.java Wed Jun  8 01:37:34 2005
@@ -0,0 +1,44 @@
+package org.apache.maven.scm;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse </a>
+ * @version $Id: ChangeLogFileTest.java,v 1.1.1.1 2004/04/20 19:05:52 jvanzyl
+ *          Exp $
+ */
+public class ChangeFileTest
+    extends TestCase
+{
+    public void testNewFile()
+    {
+        ChangeFile f = new ChangeFile( "test.java" );
+        assertEquals( "test.java", f.getName() );
+        assertEquals( null, f.getRevision() );
+        assertEquals( "test.java", f.toString() );
+    }
+
+    public void testNewRevisionFile()
+    {
+        ChangeFile f = new ChangeFile( "test.java", "revision1" );
+        assertEquals( "test.java", f.getName() );
+        assertEquals( "revision1", f.getRevision() );
+        assertEquals( "test.java, revision1", f.toString() );
+    }
+}

Added: maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeSetTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeSetTest.java?rev=189558&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeSetTest.java (added)
+++ maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeSetTest.java Wed Jun  8 01:37:34 2005
@@ -0,0 +1,148 @@
+package org.apache.maven.scm;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import junit.framework.TestCase;
+import org.apache.maven.scm.ScmTestCase;
+
+import java.util.Calendar;
+import java.util.Date;
+
+/**
+ * Tests for the {@link ChangeSet}class
+ *
+ * @author dion
+ * @version $Id: ChangeSetTest.java 162299 2005-01-18 12:31:28Z brett $
+ */
+public class ChangeSetTest
+    extends TestCase
+{
+    /** the {@link ChangeSet} used for testing */
+    private ChangeSet instance;
+
+    /**
+     * Initialize per test data
+     */
+    public void setUp()
+    {
+        instance = new ChangeSet();
+        instance.setAuthor( "dion" );
+        instance.setComment( "comment" );
+        instance.setDate( "2002/04/01 00:00:00" );
+    }
+
+    /**
+     * Test of addFile methods: using ChangeFile
+     */
+    public void testAddFileWithFile()
+    {
+        ChangeFile file = new ChangeFile( "maven:dummy" );
+        instance.setFile( file );
+        assertTrue( "File name not found in list", instance.toString().indexOf( "maven:dummy" ) != -1 );
+    }
+
+    /**
+     * Test of toString method
+     */
+    public void testToString()
+    {
+        //dion, Mon Apr 01 00:00:00 EST 2002, null, comment
+        String value = instance.toString();
+        assertTrue( "author not found in string", value.indexOf( "dion" ) != -1 );
+        assertTrue( "comment not found in string", value.indexOf( "comment" ) != -1 );
+        assertTrue( "date not found in string", value.indexOf( "Mon Apr 01" ) != -1 );
+        assertTrue( "null file not found in string" + value, value.indexOf( "null" ) != -1 );
+    }
+
+    /**
+     * Test of getAuthor method
+     */
+    public void testGetAuthor()
+    {
+        assertEquals( "Author value not retrieved correctly", "dion", instance.getAuthor() );
+    }
+
+    /**
+     * Test of setAuthor method
+     */
+    public void testSetAuthor()
+    {
+        instance.setAuthor( "maven:dion" );
+        assertEquals( "Author not set correctly", "maven:dion", instance.getAuthor() );
+    }
+
+    /**
+     * Test of getComment method
+     */
+    public void testGetComment()
+    {
+        assertEquals( "Comment value not retrieved correctly", "comment", instance.getComment() );
+    }
+
+    /**
+     * Test of setComment method
+     */
+    public void testSetComment()
+    {
+        instance.setComment( "maven:comment" );
+        assertEquals( "Comment not set correctly", "maven:comment", instance.getComment() );
+    }
+
+    /**
+     * Test of getDate method
+     */
+    public void testGetDate()
+    {
+        assertEquals( "Date value not retrieved correctly", ScmTestCase.getDate( 2002, 3, 1 ), instance.getDate() );
+    }
+
+    /**
+     * Test of setDate method with Date object
+     */
+    public void testSetDate()
+    {
+        Calendar cal = Calendar.getInstance();
+        Date date = cal.getTime();
+        instance.setDate( date );
+        assertEquals( "Date value not set correctly", date, instance.getDate() );
+    }
+
+    /**
+     * Test of setDate method with String
+     */
+    public void testSetDateFromString()
+    {
+        instance.setDate( "2002/03/04 00:00:00" );
+        assertEquals( "Date value not set correctly from a string", ScmTestCase.getDate( 2002, 2, 4 ), instance.getDate() );
+    }
+
+    /**
+     * Test of getDateFormatted method
+     */
+    public void testGetDateFormatted()
+    {
+        assertEquals( "Date not formatted correctly", "2002-04-01", instance.getDateFormatted() );
+    }
+
+    /**
+     * Test of getDateFormatted method
+     */
+    public void testGetTimeFormatted()
+    {
+        assertEquals( "Time not formatted correctly", "00:00:00", instance.getTimeFormatted() );
+    }
+}

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml Wed Jun  8 01:37:34 2005
@@ -3,7 +3,7 @@
   <parent>
     <groupId>org.apache.maven.scm</groupId>
     <artifactId>maven-scm-providers</artifactId>
-    <version>1.0-alpha-1</version>
+    <version>1.0-alpha-2-SNAPSHOT</version>
   </parent>
   <artifactId>maven-scm-provider-clearcase</artifactId>
   <name>Maven SCM Clearcase Provider</name>

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogConsumer.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogConsumer.java?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogConsumer.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogConsumer.java Wed Jun  8 01:37:34 2005
@@ -19,13 +19,10 @@
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
 
-import org.apache.maven.scm.command.changelog.ChangeLogEntry;
-import org.apache.maven.scm.command.changelog.ChangeLogFile;
+import org.apache.maven.scm.ChangeSet;
+import org.apache.maven.scm.ChangeFile;
 
 import org.codehaus.plexus.util.cli.StreamConsumer;
 import org.codehaus.plexus.logging.Logger;
@@ -43,8 +40,7 @@
     /**
      * Formatter used to parse Clearcase date/timestamp.
      */
-    private static final SimpleDateFormat CLEARCASE_TIMESTAMP_FORMAT =
-        new SimpleDateFormat( "yyyyMMdd.HHmmss" );
+    private static final SimpleDateFormat CLEARCASE_TIMESTAMP_FORMAT = new SimpleDateFormat( "yyyyMMdd.HHmmss" );
 
     private static final String NAME_TAG = "NAME:";
 
@@ -60,15 +56,7 @@
      */
     private static final SimpleDateFormat ENTRY_KEY_TIMESTAMP_FORMAT = new SimpleDateFormat( "yyyyMMddHHmm" );
 
-    /**
-     * Custom date/time formatter.  Rounds ChangeLogEntry to date
-     */
-    private static final SimpleDateFormat GROUPED_ENTRY_KEY_TIMESTAMP_FORMAT = new SimpleDateFormat( "yyyyMMdd" );
-
-    /**
-     * rcs entries, in reverse (date, time, author, comment) order
-     */
-    private Map entries = new TreeMap( Collections.reverseOrder() );
+    private List entries = new ArrayList();
 
     // state machine constants for reading clearcase lshistory command output
     /**
@@ -94,12 +82,12 @@
     /**
      * the current log entry being processed by the parser
      */
-    private ChangeLogEntry currentLogEntry = null;
+    private ChangeSet currentChange = null;
 
     /**
      * the current file being processed by the parser
      */
-    private ChangeLogFile currentFile = null;
+    private ChangeFile currentFile = null;
 
     // ----------------------------------------------------------------------
     //
@@ -116,7 +104,7 @@
 
     public List getModifications()
     {
-        return new ArrayList( entries.values() );
+        return entries;
     }
 
     // ----------------------------------------------------------------------
@@ -146,43 +134,6 @@
     // ----------------------------------------------------------------------
 
     /**
-     * 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. 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;
-        }
-        // do not add if the operation is not checkin
-        if ( entry.getComment().indexOf( "- checkin" ) == -1 )
-        {
-            return;
-        }
-
-        String key = ENTRY_KEY_TIMESTAMP_FORMAT.format( entry.getDate() )
-                     + entry.getAuthor() + entry.getComment();
-
-        if ( !entries.containsKey( key ) )
-        {
-            entry.addFile( file );
-            entries.put( key, entry );
-        }
-        else
-        {
-            ChangeLogEntry existingEntry = (ChangeLogEntry) entries.get( key );
-            existingEntry.addFile( file );
-        }
-    }
-
-    /**
      * Process the current input line in the Get File state.
      *
      * @param line a line of text from the clearcase log output
@@ -191,8 +142,8 @@
     {
         if ( line.startsWith( NAME_TAG ) )
         {
-            setCurrentLogEntry( new ChangeLogEntry() );
-            setCurrentFile( new ChangeLogFile( line.substring( NAME_TAG.length(), line.length() ) ) );
+            setCurrentChange( new ChangeSet() );
+            setCurrentFile( new ChangeFile( line.substring( NAME_TAG.length(), line.length() ) ) );
             setStatus( GET_DATE );
         }
     }
@@ -208,11 +159,10 @@
         {
             try
             {
-                getCurrentLogEntry().setDate( CLEARCASE_TIMESTAMP_FORMAT.parse( line.substring( DATE_TAG.length() ) ) );
+                getCurrentChange().setDate( CLEARCASE_TIMESTAMP_FORMAT.parse( line.substring( DATE_TAG.length() ) ) );
             }
             catch ( ParseException e )
             {
-                // TODO Auto-generated catch block
                 e.printStackTrace();
             }
             setStatus( GET_COMMENT );
@@ -230,21 +180,23 @@
         {
             String comm = line.substring( COMMENT_TAG.length() );
 
-            getCurrentLogEntry().setComment( getCurrentLogEntry().getComment() + comm + "\n" );
+            getCurrentChange().setComment( getCurrentChange().getComment() + comm + "\n" );
         }
         else if ( line.startsWith( USER_TAG ) )
         {
-            getCurrentLogEntry().setAuthor( line.substring( USER_TAG.length() ) );
+            getCurrentChange().setAuthor( line.substring( USER_TAG.length() ) );
 
             // add entry, and set state to get file
-            addEntry( getCurrentLogEntry(), getCurrentFile() );
+            getCurrentChange().setFile( getCurrentFile() );
+
+            entries.add( getCurrentChange() );
 
             setStatus( GET_FILE );
         }
         else
         {
             // keep gathering comments
-            getCurrentLogEntry().setComment( getCurrentLogEntry().getComment() + line + "\n" );
+            getCurrentChange().setComment( getCurrentChange().getComment() + line + "\n" );
         }
     }
 
@@ -253,7 +205,7 @@
      *
      * @return Value of property currentFile.
      */
-    private ChangeLogFile getCurrentFile()
+    private ChangeFile getCurrentFile()
     {
         return currentFile;
     }
@@ -263,19 +215,19 @@
      *
      * @param currentFile New value of property currentFile.
      */
-    private void setCurrentFile( ChangeLogFile currentFile )
+    private void setCurrentFile( ChangeFile currentFile )
     {
         this.currentFile = currentFile;
     }
 
     /**
-     * Getter for property currentLogEntry.
+     * Getter for property currentChange.
      *
-     * @return Value of property currentLogEntry.
+     * @return Value of property currentChange.
      */
-    private ChangeLogEntry getCurrentLogEntry()
+    private ChangeSet getCurrentChange()
     {
-        return currentLogEntry;
+        return currentChange;
     }
 
     /**
@@ -283,9 +235,9 @@
      *
      * @param currentLogEntry New value of property currentLogEntry.
      */
-    private void setCurrentLogEntry( ChangeLogEntry currentLogEntry )
+    private void setCurrentChange( ChangeSet currentChange )
     {
-        this.currentLogEntry = currentLogEntry;
+        this.currentChange = currentChange;
     }
 
     /**

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml Wed Jun  8 01:37:34 2005
@@ -3,7 +3,7 @@
   <parent>
     <groupId>org.apache.maven.scm</groupId>
     <artifactId>maven-scm-providers</artifactId>
-    <version>1.0-alpha-1</version>
+    <version>1.0-alpha-2-SNAPSHOT</version>
   </parent>
   <artifactId>maven-scm-provider-cvs</artifactId>
   <name>Maven SCM CVS Provider</name>

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.java?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.java Wed Jun  8 01:37:34 2005
@@ -1,7 +1,7 @@
 package org.apache.maven.scm.provider.cvslib.command.changelog;
 
 /*
- * Copyright 2001-2004 The Apache Software Foundation.
+ * Copyright 2001-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,18 +16,14 @@
  * limitations under the License.
  */
 
-import org.apache.maven.scm.command.changelog.ChangeLogEntry;
-import org.apache.maven.scm.command.changelog.ChangeLogFile;
+import org.apache.maven.scm.ChangeSet;
+import org.apache.maven.scm.ChangeFile;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.cli.StreamConsumer;
 
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
-import java.util.Map;
 import java.util.StringTokenizer;
-import java.util.TreeMap;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse </a>
@@ -37,16 +33,7 @@
 public class CvsChangeLogConsumer
     implements StreamConsumer
 {
-    /**
-     * Custom date/time formatter. Rounds ChangeLogEntry times to the nearest
-     * minute.
-     */
-    private static final SimpleDateFormat ENTRY_KEY_TIMESTAMP_FORMAT = new SimpleDateFormat( "yyyyMMddHHmm" );
-
-    /**
-     * rcs entries, in reverse (date, time, author, comment) order
-     */
-    private Map entries = new TreeMap( Collections.reverseOrder() );
+    private List entries = new ArrayList();
 
     // state machine constants for reading cvs output
     /** expecting file information */
@@ -66,7 +53,7 @@
 
     /** Marks end of file */
     private static final String END_FILE = "==================================="
-        + "==========================================";
+                                           + "==========================================";
 
     /** Marks start of revision */
     private static final String START_REVISION = "----------------------------";
@@ -81,10 +68,11 @@
     private int status = GET_FILE;
 
     /** the current log entry being processed by the parser */
-    private ChangeLogEntry currentLogEntry = null;
+    private ChangeSet currentChange = null;
 
     /** the current file being processed by the parser */
-    private ChangeLogFile currentFile = null;
+    private ChangeFile currentFile = null;
+
     private Logger logger;
 
     public CvsChangeLogConsumer( Logger logger )
@@ -94,33 +82,32 @@
 
     public List getModifications()
     {
-        return new ArrayList( entries.values() );
+        return entries;
     }
 
     public void consumeLine( String line )
     {
-
         try
         {
             switch ( getStatus() )
             {
-            case GET_FILE:
-                processGetFile( line );
-                break;
-            case GET_REVISION:
-                processGetRevision( line );
-                break;
-            case GET_DATE:
-                processGetDate( line );
-                break;
-            case GET_COMMENT:
-                processGetComment( line );
-                break;
-            default:
-                throw new IllegalStateException( "Unknown state: " + status );
+                case GET_FILE:
+                    processGetFile( line );
+                    break;
+                case GET_REVISION:
+                    processGetRevision( line );
+                    break;
+                case GET_DATE:
+                    processGetDate( line );
+                    break;
+                case GET_COMMENT:
+                    processGetComment( line );
+                    break;
+                default:
+                    throw new IllegalStateException( "Unknown state: " + status );
             }
         }
-        catch( Throwable ex )
+        catch ( Throwable ex )
         {
             logger.warn( "Exception in the cvs changelog consumer.", ex );
         }
@@ -130,12 +117,12 @@
      * 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
+     * @param entry a {@link ChangeSet}to be added to the list if another
      *              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
+     * @param file  a {@link ChangeFile}to be added to the entry
      */
-    private void addEntry( ChangeLogEntry entry, ChangeLogFile file )
+    private void addEntry( ChangeSet entry, ChangeFile file )
     {
         // do not add if entry is not populated
         if ( entry.getAuthor() == null )
@@ -143,18 +130,8 @@
             return;
         }
 
-        String key = ENTRY_KEY_TIMESTAMP_FORMAT.format( entry.getDate() ) + entry.getAuthor() + entry.getComment();
-
-        if ( !entries.containsKey( key ) )
-        {
-            entry.addFile( file );
-            entries.put( key, entry );
-        }
-        else
-        {
-            ChangeLogEntry existingEntry = (ChangeLogEntry) entries.get( key );
-            existingEntry.addFile( file );
-        }
+        entry.setFile( file );
+        entries.add( entry );
     }
 
     /**
@@ -166,8 +143,8 @@
     {
         if ( line.startsWith( START_FILE ) )
         {
-            setCurrentLogEntry( new ChangeLogEntry() );
-            setCurrentFile( new ChangeLogFile( line.substring( START_FILE.length(), line.length() ) ) );
+            setCurrentChange( new ChangeSet() );
+            setCurrentFile( new ChangeFile( line.substring( START_FILE.length(), line.length() ) ) );
             setStatus( GET_REVISION );
         }
     }
@@ -190,7 +167,7 @@
             // are no more revisions for the current file.
             // there could also be a file still being processed.
             setStatus( GET_FILE );
-            addEntry( getCurrentLogEntry(), getCurrentFile() );
+            addEntry( getCurrentChange(), getCurrentFile() );
         }
     }
 
@@ -208,11 +185,11 @@
             tokenizer.nextToken(); // date tag
             String date = tokenizer.nextToken();
             String time = tokenizer.nextToken();
-            getCurrentLogEntry().setDate( date + " " + time );
+            getCurrentChange().setDate( date + " " + time );
             tokenizer.nextToken(); // author tag
             // assumes author can't contain spaces
             String author = tokenizer.nextToken();
-            getCurrentLogEntry().setAuthor( author );
+            getCurrentChange().setAuthor( author );
             setStatus( GET_COMMENT );
         }
     }
@@ -227,22 +204,22 @@
         if ( line.startsWith( START_REVISION ) )
         {
             // add entry, and set state to get revision
-            addEntry( getCurrentLogEntry(), getCurrentFile() );
+            addEntry( getCurrentChange(), getCurrentFile() );
             // new change log entry
-            setCurrentLogEntry( new ChangeLogEntry() );
+            setCurrentChange( new ChangeSet() );
             // same file name, but different rev
-            setCurrentFile( new ChangeLogFile( getCurrentFile().getName() ) );
+            setCurrentFile( new ChangeFile( getCurrentFile().getName() ) );
             setStatus( GET_REVISION );
         }
         else if ( line.startsWith( END_FILE ) )
         {
-            addEntry( getCurrentLogEntry(), getCurrentFile() );
+            addEntry( getCurrentChange(), getCurrentFile() );
             setStatus( GET_FILE );
         }
         else
         {
             // keep gathering comments
-            getCurrentLogEntry().setComment( getCurrentLogEntry().getComment() + line + "\n" );
+            getCurrentChange().setComment( getCurrentChange().getComment() + line + "\n" );
         }
     }
 
@@ -251,7 +228,7 @@
      *
      * @return Value of property currentFile.
      */
-    private ChangeLogFile getCurrentFile()
+    private ChangeFile getCurrentFile()
     {
         return currentFile;
     }
@@ -261,29 +238,29 @@
      *
      * @param currentFile New value of property currentFile.
      */
-    private void setCurrentFile( ChangeLogFile currentFile )
+    private void setCurrentFile( ChangeFile currentFile )
     {
         this.currentFile = currentFile;
     }
 
     /**
-     * Getter for property currentLogEntry.
+     * Getter for property currentChange.
      *
-     * @return Value of property currentLogEntry.
+     * @return Value of property currentChange.
      */
-    private ChangeLogEntry getCurrentLogEntry()
+    private ChangeSet getCurrentChange()
     {
-        return currentLogEntry;
+        return currentChange;
     }
 
     /**
-     * Setter for property currentLogEntry.
+     * Setter for property currentChange.
      *
-     * @param currentLogEntry New value of property currentLogEntry.
+     * @param currentChange New value of property currentChange.
      */
-    private void setCurrentLogEntry( ChangeLogEntry currentLogEntry )
+    private void setCurrentChange( ChangeSet currentChange )
     {
-        this.currentLogEntry = currentLogEntry;
+        this.currentChange = currentChange;
     }
 
     /**

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumerTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumerTest.java?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumerTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumerTest.java Wed Jun  8 01:37:34 2005
@@ -1,7 +1,7 @@
 package org.apache.maven.scm.provider.cvslib.command.changelog;
 
 /*
- * Copyright 2001-2004 The Apache Software Foundation.
+ * Copyright 2001-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-import org.apache.maven.scm.command.changelog.ChangeLogEntry;
+import org.apache.maven.scm.ChangeSet;
 import org.apache.maven.scm.provider.cvslib.AbstractCvsScmTest;
 
 import java.io.BufferedReader;
@@ -35,45 +35,45 @@
     extends AbstractCvsScmTest
 {
     /** file with test results to check against */
-	private File testFile;
+    private File testFile;
 
-	/**
-	 * Initialize per test data
-	 * @throws Exception when there is an unexpected problem
-	 */
-	public void setUp() throws Exception
-	{
+    /**
+     * Initialize per test data
+     * @throws Exception when there is an unexpected problem
+     */
+    public void setUp()
+        throws Exception
+    {
         super.setUp();
 
         testFile = getTestFile( "/src/test/resources/cvslib/changelog/cvslog.txt" );
-	}
+    }
 
-	/**
-	 * Test of parse method
-	 * @throws Exception when there is an unexpected problem
-	 */
-	public void testParse()
+    /**
+     * Test of parse method
+     * @throws Exception when there is an unexpected problem
+     */
+    public void testParse()
         throws Exception
-	{
+    {
         CvsChangeLogConsumer command = new CvsChangeLogConsumer( null );
 
         FileInputStream fis = new FileInputStream( testFile );
-		BufferedReader in = new BufferedReader(new InputStreamReader(fis));
-		String s = in.readLine();
-		while ( s != null )
-		{
-			command.consumeLine( s );
-			s = in.readLine();
-		}
-
-		Collection entries = command.getModifications();
-		assertEquals("Wrong number of entries returned", 3, entries.size());
-		ChangeLogEntry entry = null;
-		for (Iterator i = entries.iterator(); i.hasNext(); )
-		{
-			entry = (ChangeLogEntry) i.next();
-			assertTrue("ChangeLogEntry erroneously picked up",
-				entry.toString().indexOf("ChangeLogEntry.java") == -1);
-		}
-	}
+        BufferedReader in = new BufferedReader( new InputStreamReader( fis ) );
+        String s = in.readLine();
+        while ( s != null )
+        {
+            command.consumeLine( s );
+            s = in.readLine();
+        }
+
+        Collection entries = command.getModifications();
+        assertEquals( "Wrong number of entries returned", 3, entries.size() );
+        ChangeSet entry = null;
+        for ( Iterator i = entries.iterator(); i.hasNext(); )
+        {
+            entry = (ChangeSet) i.next();
+            assertTrue( "ChangeLogEntry erroneously picked up", entry.toString().indexOf( "ChangeLogEntry.java" ) == -1 );
+        }
+    }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml Wed Jun  8 01:37:34 2005
@@ -3,7 +3,7 @@
   <parent>
     <groupId>org.apache.maven.scm</groupId>
     <artifactId>maven-scm-providers</artifactId>
-    <version>1.0-alpha-1</version>
+    <version>1.0-alpha-2-SNAPSHOT</version>
   </parent>
   <artifactId>maven-scm-provider-perforce</artifactId>
   <name>Maven SCM Perforce Provider</name>

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogConsumer.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogConsumer.java?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogConsumer.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogConsumer.java Wed Jun  8 01:37:34 2005
@@ -18,15 +18,12 @@
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Collections;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
 import java.util.ArrayList;
 
-import org.apache.maven.scm.command.changelog.ChangeLogEntry;
-import org.apache.maven.scm.command.changelog.ChangeLogFile;
+import org.apache.maven.scm.ChangeSet;
+import org.apache.maven.scm.ChangeFile;
 import org.apache.regexp.RE;
 import org.apache.regexp.RESyntaxException;
 
@@ -42,13 +39,9 @@
     /**
      * Date formatter for perforce timestamp
      */
-    private static final SimpleDateFormat PERFORCE_TIMESTAMP =
-        new SimpleDateFormat( "yyyy/MM/dd HH:mm:ss" );
+    private static final SimpleDateFormat PERFORCE_TIMESTAMP = new SimpleDateFormat( "yyyy/MM/dd HH:mm:ss" );
 
-    /**
-     * RCS entries, in reverse changelist number order
-     */
-    private Map entries = new TreeMap( Collections.reverseOrder() );
+    private List entries = new ArrayList();
 
     /**
      * State machine constant: expecting revision and/or file information
@@ -83,7 +76,7 @@
     /**
      * The current log entry being processed by the parser
      */
-    private ChangeLogEntry currentLogEntry;
+    private ChangeSet currentChange;
 
     /**
      * the current file being processed by the parser
@@ -99,11 +92,10 @@
 
     private Date endDate;
 
-    private static final String pattern =
-        "^\\.\\.\\. #(\\d+) " + // revision number
-        "change (\\d+) .* " + // changelist number
-        "on (.*) " + // date
-        "by (.*)@";                       // author
+    private static final String pattern = "^\\.\\.\\. #(\\d+) " + // revision number
+                                          "change (\\d+) .* " + // changelist number
+                                          "on (.*) " + // date
+                                          "by (.*)@"; // author
 
     public PerforceChangeLogConsumer( Date startDate, Date endDate )
     {
@@ -127,7 +119,7 @@
 
     public List getModifications()
     {
-        return new ArrayList( entries.values() );
+        return entries;
     }
 
     // ----------------------------------------------------------------------
@@ -164,17 +156,13 @@
      *              with the same key (p4 change number) doesn't exist already.
      * @param file  a {@link ChangeLogFile} to be added to the entry
      */
-    private void addEntry( ChangeLogEntry entry, ChangeLogFile file )
+    private void addEntry( ChangeSet entry, ChangeFile file )
     {
-        System.out.println();
-
-        System.out.println( entry.toXML() );
-
         // ----------------------------------------------------------------------
         // Check that we are inside the requested date range
         // ----------------------------------------------------------------------
 
-        if ( startDate != null && entry.getDate().before( startDate )  )
+        if ( startDate != null && entry.getDate().before( startDate ) )
         {
             return;
         }
@@ -188,17 +176,9 @@
         //
         // ----------------------------------------------------------------------
 
-        Integer key = new Integer( revisionRegexp.getParen( 2 ) );
-        if ( !entries.containsKey( key ) )
-        {
-            entry.addFile( file );
-            entries.put( key, entry );
-        }
-        else
-        {
-            ChangeLogEntry existingEntry = (ChangeLogEntry) entries.get( key );
-            existingEntry.addFile( file );
-        }
+        entry.setFile( file );
+
+        entries.add( entry );
     }
 
     /**
@@ -212,6 +192,7 @@
         if ( line.startsWith( FILE_BEGIN_TOKEN ) )
         {
             currentFile = line;
+
             return;
         }
 
@@ -220,9 +201,11 @@
             return;
         }
 
-        currentLogEntry = new ChangeLogEntry();
-        currentLogEntry.setDate( parseDate( revisionRegexp.getParen( 3 ) ) );
-        currentLogEntry.setAuthor( revisionRegexp.getParen( 4 ) );
+        currentChange = new ChangeSet();
+
+        currentChange.setDate( parseDate( revisionRegexp.getParen( 3 ) ) );
+
+        currentChange.setAuthor( revisionRegexp.getParen( 4 ) );
 
         status = GET_COMMENT_BEGIN;
     }
@@ -237,12 +220,13 @@
     {
         if ( line.equals( COMMENT_DELIMITER ) )
         {
-            addEntry( currentLogEntry, new ChangeLogFile( currentFile, revisionRegexp.getParen( 1 ) ) );
+            addEntry( currentChange, new ChangeFile( currentFile, revisionRegexp.getParen( 1 ) ) );
+
             status = GET_REVISION;
         }
         else
         {
-            currentLogEntry.setComment( currentLogEntry.getComment() + line + "\n" );
+            currentChange.setComment( currentChange.getComment() + line + "\n" );
         }
     }
 

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogConsumerTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogConsumerTest.java?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogConsumerTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogConsumerTest.java Wed Jun  8 01:37:34 2005
@@ -23,7 +23,7 @@
 import java.util.ArrayList;
 
 import org.apache.maven.scm.ScmTestCase;
-import org.apache.maven.scm.command.changelog.ChangeLogEntry;
+import org.apache.maven.scm.ChangeSet;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -49,60 +49,11 @@
         }
 
         ArrayList entries = new ArrayList( consumer.getModifications() );
-        assertEquals( "Wrong number of entries returned", 7, entries.size() );
-        ChangeLogEntry entry = (ChangeLogEntry) entries.get( 0 );
-        assertEquals( "Entry 0 was parsed incorrectly",
-                      "\t<changelog-entry>\n" +
-                      "\t\t<date>2003-10-15</date>\n" +
-                      "\t\t<time>13:38:40</time>\n" +
-                      "\t\t<author><![CDATA[jim]]></author>\n" +
-                      "\t\t<file>\n" +
-                      "\t\t\t<name>//depot/test/junk/linefeed.txt</name>\n" +
-                      "\t\t\t<revision>3</revision>\n" +
-                      "\t\t</file>\n" +
-                      "\t\t<msg><![CDATA[	Where's my change #\n" +
-                      "]]></msg>\n" +
-                      "\t</changelog-entry>\n",
-                      entry.toXML() );
-
-        entry = (ChangeLogEntry) entries.get( 3 );
-        assertEquals( "Entry 3 was parsed incorrectly",
-                      "\t<changelog-entry>\n" +
-                      "\t\t<date>2003-10-01</date>\n" +
-                      "\t\t<time>16:24:20</time>\n" +
-                      "\t\t<author><![CDATA[jim]]></author>\n" +
-                      "\t\t<file>\n" +
-                      "\t\t\t<name>//depot/test/demo/demo.c</name>\n" +
-                      "\t\t\t<revision>4</revision>\n" +
-                      "\t\t</file>\n" +
-                      "\t\t<msg><![CDATA[	Backing out my test changes\n" +
-                      "\t\n" +
-                      "\tUpdating a description\n" +
-                      "]]></msg>\n" +
-                      "\t</changelog-entry>\n",
-                      entry.toXML() );
-
-        entry = (ChangeLogEntry) entries.get( 6 );
-        assertEquals( "Entry 6 was parsed incorrectly",
-                      "\t<changelog-entry>\n" +
-                      "\t\t<date>2003-08-07</date>\n" +
-                      "\t\t<time>17:21:57</time>\n" +
-                      "\t\t<author><![CDATA[mcronin]]></author>\n" +
-                      "\t\t<file>\n" +
-                      "\t\t\t<name>//depot/test/demo/demo.c</name>\n" +
-                      "\t\t\t<revision>1</revision>\n" +
-                      "\t\t</file>\n" +
-                      "\t\t<file>\n" +
-                      "\t\t\t<name>//depot/test/demo/dictcalls.txt</name>\n" +
-                      "\t\t\t<revision>1</revision>\n" +
-                      "\t\t</file>\n" +
-                      "\t\t<file>\n" +
-                      "\t\t\t<name>//depot/test/demo/dictwords.txt</name>\n" +
-                      "\t\t\t<revision>1</revision>\n" +
-                      "\t\t</file>\n" +
-                      "\t\t<msg><![CDATA[	demonstration of Perforce on Windows, Unix and VMS.\n" +
-                      "]]></msg>\n" +
-                      "\t</changelog-entry>\n",
-                      entry.toXML() );
+        assertEquals( "Wrong number of entries returned", 9, entries.size() );
+        ChangeSet entry = (ChangeSet) entries.get( 0 );
+        assertEquals( "jim", entry.getAuthor() );
+        assertEquals( "//depot/test/demo/demo.c", entry.getFile().getName() );
+        assertEquals( "2003-10-01", entry.getDateFormatted() );
+        assertEquals( "16:24:20", entry.getTimeFormatted() );
     }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml Wed Jun  8 01:37:34 2005
@@ -3,7 +3,7 @@
   <parent>
     <groupId>org.apache.maven.scm</groupId>
     <artifactId>maven-scm-providers</artifactId>
-    <version>1.0-alpha-1</version>
+    <version>1.0-alpha-2-SNAPSHOT</version>
   </parent>
   <artifactId>maven-scm-provider-starteam</artifactId>
   <name>Maven SCM Starteam Provider</name>

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumer.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumer.java?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumer.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumer.java Wed Jun  8 01:37:34 2005
@@ -19,14 +19,11 @@
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
 
-import org.apache.maven.scm.command.changelog.ChangeLogEntry;
-import org.apache.maven.scm.command.changelog.ChangeLogFile;
+import org.apache.maven.scm.ChangeSet;
+import org.apache.maven.scm.ChangeFile;
 
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.cli.StreamConsumer;
@@ -40,18 +37,9 @@
 {
     private Logger logger;
 
-    /**
-     * Custom date/time formatter.  Rounds ChangeLogEntry times to the nearest
-     * minute.
-     */
-    private static final SimpleDateFormat ENTRY_KEY_TIMESTAMP_FORMAT = new SimpleDateFormat( "yyyyMMddHHmm" );
-
     private SimpleDateFormat localFormat = new SimpleDateFormat();
 
-    /**
-     * rcs entries, in reverse (date, time, author, comment) order
-     */
-    private Map entries = new TreeMap( Collections.reverseOrder() );
+    private List entries = new ArrayList();
 
     // state machine constants for reading Starteam output
     /**
@@ -113,12 +101,12 @@
     /**
      * the current log entry being processed by the parser
      */
-    private ChangeLogEntry currentLogEntry = null;
+    private ChangeSet currentChange = null;
 
     /**
      * the current file being processed by the parser
      */
-    private ChangeLogFile currentFile = null;
+    private ChangeFile currentFile = null;
 
     /**
      * the before date
@@ -149,7 +137,7 @@
 
     public List getModifications()
     {
-        return new ArrayList( entries.values() );
+        return entries;
     }
 
     // ----------------------------------------------------------------------
@@ -195,7 +183,7 @@
      *              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 )
+    private void addEntry( ChangeSet entry, ChangeFile file )
     {
         // do not add if entry is not populated
         if ( entry.getAuthor() == null )
@@ -214,20 +202,9 @@
             return;
         }
 
-        String key = ENTRY_KEY_TIMESTAMP_FORMAT.format( entry.getDate() ) + entry.getAuthor() + entry.getComment();
-
-        if ( !entries.containsKey( key ) )
-        {
-            entry.addFile( file );
+        entry.setFile( file );
 
-            entries.put( key, entry );
-        }
-        else
-        {
-            ChangeLogEntry existingEntry = (ChangeLogEntry) entries.get( key );
-
-            existingEntry.addFile( file );
-        }
+        entries.add( entry );
     }
 
     /**
@@ -239,9 +216,9 @@
     {
         if ( line.startsWith( START_FILE ) )
         {
-            setCurrentLogEntry( new ChangeLogEntry() );
+            setCurrentChange( new ChangeSet() );
 
-            setCurrentFile( new ChangeLogFile( line.substring( START_FILE.length(), line.length() ) ) );
+            setCurrentFile( new ChangeFile( line.substring( START_FILE.length(), line.length() ) ) );
 
             setStatus( GET_REVISION );
         }
@@ -269,7 +246,7 @@
             // there could also be a file still being processed.
             setStatus( GET_FILE );
 
-            addEntry( getCurrentLogEntry(), getCurrentFile() );
+            addEntry( getCurrentChange(), getCurrentFile() );
         }
     }
 
@@ -286,11 +263,11 @@
 
             String author = line.substring( AUTHOR_TAG.length(), posDateTag );
 
-            getCurrentLogEntry().setAuthor( author );
+            getCurrentChange().setAuthor( author );
 
             String date = line.substring( posDateTag + DATE_TAG.length() );
 
-            getCurrentLogEntry().setDate( parseDate( date ) );
+            getCurrentChange().setDate( parseDate( date ) );
 
             setStatus( GET_COMMENT );
         }
@@ -306,25 +283,26 @@
         if ( line.startsWith( START_REVISION ) )
         {
             // add entry, and set state to get revision
-            addEntry( getCurrentLogEntry(), getCurrentFile() );
+            addEntry( getCurrentChange(), getCurrentFile() );
 
             // new change log entry
-            setCurrentLogEntry( new ChangeLogEntry() );
+            setCurrentChange( new ChangeSet() );
 
             // same file name, but different rev
-            setCurrentFile( new ChangeLogFile( getCurrentFile().getName() ) );
+            setCurrentFile( new ChangeFile( getCurrentFile().getName() ) );
+
             setStatus( GET_REVISION );
         }
         else if ( line.startsWith( END_FILE ) )
         {
-            addEntry( getCurrentLogEntry(), getCurrentFile() );
+            addEntry( getCurrentChange(), getCurrentFile() );
 
             setStatus( GET_FILE );
         }
         else
         {
             // keep gathering comments
-            getCurrentLogEntry().setComment( getCurrentLogEntry().getComment() + line + "\n" );
+            getCurrentChange().setComment( getCurrentChange().getComment() + line + "\n" );
         }
     }
 
@@ -333,7 +311,7 @@
      *
      * @return Value of property currentFile.
      */
-    private ChangeLogFile getCurrentFile()
+    private ChangeFile getCurrentFile()
     {
         return currentFile;
     }
@@ -343,29 +321,29 @@
      *
      * @param currentFile New value of property currentFile.
      */
-    private void setCurrentFile( ChangeLogFile currentFile )
+    private void setCurrentFile( ChangeFile currentFile )
     {
         this.currentFile = currentFile;
     }
 
     /**
-     * Getter for property currentLogEntry.
+     * Getter for property currentChange.
      *
-     * @return Value of property currentLogEntry.
+     * @return Value of property currentChange.
      */
-    private ChangeLogEntry getCurrentLogEntry()
+    private ChangeSet getCurrentChange()
     {
-        return currentLogEntry;
+        return currentChange;
     }
 
     /**
-     * Setter for property currentLogEntry.
+     * Setter for property currentChange.
      *
-     * @param currentLogEntry New value of property currentLogEntry.
+     * @param currentChange New value of property currentChange.
      */
-    private void setCurrentLogEntry( ChangeLogEntry currentLogEntry )
+    private void setCurrentChange( ChangeSet currentChange )
     {
-        this.currentLogEntry = currentLogEntry;
+        this.currentChange = currentChange;
     }
 
     /**
@@ -402,7 +380,7 @@
         }
         catch ( ParseException e )
         {
-            logger.error("ParseException Caught", e);
+            logger.error( "ParseException Caught", e );
 
             return null;
         }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumerTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumerTest.java?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumerTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumerTest.java Wed Jun  8 01:37:34 2005
@@ -25,7 +25,7 @@
 import java.util.Locale;
 
 import org.apache.maven.scm.ScmTestCase;
-import org.apache.maven.scm.command.changelog.ChangeLogEntry;
+import org.apache.maven.scm.ChangeSet;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -66,16 +66,15 @@
 
         Collection entries = consumer.getModifications();
 
-        assertEquals( "Wrong number of entries returned", 3, entries.size() );
+        assertEquals( "Wrong number of entries returned", 6, entries.size() );
 
-        ChangeLogEntry entry = null;
+        ChangeSet entry = null;
 
         for ( Iterator i = entries.iterator(); i.hasNext(); )
         {
-            entry = (ChangeLogEntry) i.next();
+            entry = (ChangeSet) i.next();
 
-            assertTrue( "ChangeLogEntry erroneously picked up",
-                        entry.toString().indexOf( "ChangeLogEntry.java" ) == -1 );
+            assertTrue( "ChangeLogEntry erroneously picked up", entry.toString().indexOf( "ChangeLogEntry.java" ) == -1 );
         }
     }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml Wed Jun  8 01:37:34 2005
@@ -3,7 +3,7 @@
   <parent>
     <groupId>org.apache.maven.scm</groupId>
     <artifactId>maven-scm-providers</artifactId>
-    <version>1.0-alpha-1</version>
+    <version>1.0-alpha-2-SNAPSHOT</version>
   </parent>
   <artifactId>maven-scm-provider-svn</artifactId>
   <name>Maven SCM Subversion Provider</name>

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.java?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.java Wed Jun  8 01:37:34 2005
@@ -1,7 +1,7 @@
 package org.apache.maven.scm.provider.svn.command.changelog;
 
 /*
- * Copyright 2003-2004 The Apache Software Foundation.
+ * Copyright 2003-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
  * limitations under the License.
  */
 
-import org.apache.maven.scm.command.changelog.ChangeLogEntry;
-import org.apache.maven.scm.command.changelog.ChangeLogFile;
+import org.apache.maven.scm.ChangeSet;
+import org.apache.maven.scm.ChangeFile;
 import org.apache.regexp.RE;
 import org.apache.regexp.RESyntaxException;
 import org.codehaus.plexus.util.cli.StreamConsumer;
@@ -36,7 +36,7 @@
     implements StreamConsumer
 {
     /** Date formatter for svn timestamp (after a little massaging) */
-    private static final SimpleDateFormat SVN_TIMESTAMP = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss zzzzzzzzz");
+    private static final SimpleDateFormat SVN_TIMESTAMP = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss zzzzzzzzz" );
 
     /** State machine constant: expecting header */
     private static final int GET_HEADER = 1;
@@ -57,17 +57,15 @@
     private static final int FILE_START_INDEX = 5;
 
     /** The comment section ends with a dashed line */
-    private static final String COMMENT_END_TOKEN =
-        "------------------------------------" +
-        "------------------------------------";
+    private static final String COMMENT_END_TOKEN = "------------------------------------"
+                                                    + "------------------------------------";
 
     /** The pattern used to match svn header lines */
-    private static final String pattern =
-        "^rev (\\d+):\\s+" + // revision number
-        "(\\w+)\\s+\\|\\s+" + // author username
-        "(\\d+-\\d+-\\d+ " + // date 2002-08-24
-        "\\d+:\\d+:\\d+) " + // time 16:01:00
-        "([\\-+])(\\d\\d)(\\d\\d)"; // gmt offset -0400
+    private static final String pattern = "^rev (\\d+):\\s+" + // revision number
+                                          "(\\w+)\\s+\\|\\s+" + // author username
+                                          "(\\d+-\\d+-\\d+ " + // date 2002-08-24
+                                          "\\d+:\\d+:\\d+) " + // time 16:01:00
+                                          "([\\-+])(\\d\\d)(\\d\\d)"; // gmt offset -0400
 
     /** Current status of the parser */
     private int status = GET_HEADER;
@@ -76,7 +74,7 @@
     private List entries = new ArrayList();
 
     /** The current log entry being processed by the parser */
-    private ChangeLogEntry currentLogEntry;
+    private ChangeSet currentChange;
 
     /** The current revision of the entry being processed by the parser */
     private String currentRevision;
@@ -94,11 +92,13 @@
     {
         try
         {
-            headerRegexp = new RE(pattern);
+            headerRegexp = new RE( pattern );
         }
         catch ( RESyntaxException ex )
         {
-            throw new RuntimeException( "INTERNAL ERROR: Could not create regexp to parse svn log file. This shouldn't happen. Something is probably wrong with the oro installation.", ex );
+            throw new RuntimeException(
+                                        "INTERNAL ERROR: Could not create regexp to parse svn log file. This shouldn't happen. Something is probably wrong with the oro installation.",
+                                        ex );
         }
     }
 
@@ -111,21 +111,21 @@
     // StreamConsumer Implementation
     // ----------------------------------------------------------------------
 
-    public void consumeLine(String line)
+    public void consumeLine( String line )
     {
-        switch (status)
+        switch ( status )
         {
-            case GET_HEADER :
-                processGetHeader(line);
+            case GET_HEADER:
+                processGetHeader( line );
                 break;
-            case GET_FILE :
-                processGetFile(line);
+            case GET_FILE:
+                processGetFile( line );
                 break;
-            case GET_COMMENT :
-                processGetComment(line);
+            case GET_COMMENT:
+                processGetComment( line );
                 break;
-            default :
-                throw new IllegalStateException("Unknown state: " + status);
+            default:
+                throw new IllegalStateException( "Unknown state: " + status );
         }
     }
 
@@ -142,20 +142,20 @@
      *
      * @param line A line of text from the svn log output
      */
-    private void processGetHeader(String line)
+    private void processGetHeader( String line )
     {
-        if (!headerRegexp.match(line))
+        if ( !headerRegexp.match( line ) )
         {
             return;
         }
 
         currentRevision = headerRegexp.getParen( 1 );
 
-        currentLogEntry = new ChangeLogEntry();
+        currentChange = new ChangeSet();
 
-        currentLogEntry.setAuthor( headerRegexp.getParen( 2 ) );
+        currentChange.setAuthor( headerRegexp.getParen( 2 ) );
 
-        currentLogEntry.setDate( parseDate() );
+        currentChange.setDate( parseDate() );
 
         status = GET_FILE;
     }
@@ -168,17 +168,17 @@
      *
      * @param line A line of text from the svn log output
      */
-    private void processGetFile(String line)
+    private void processGetFile( String line )
     {
-        if (line.startsWith(FILE_BEGIN_TOKEN))
+        if ( line.startsWith( FILE_BEGIN_TOKEN ) )
         {
             // Skip the status flags and just get the name of the file
-            String name = line.substring(FILE_START_INDEX);
-            currentLogEntry.addFile(new ChangeLogFile(name, currentRevision));
+            String name = line.substring( FILE_START_INDEX );
+            currentChange.setFile( new ChangeFile( name, currentRevision ) );
 
             status = GET_FILE;
         }
-        else if (line.equals(FILE_END_TOKEN))
+        else if ( line.equals( FILE_END_TOKEN ) )
         {
             // Create a buffer for the collection of the comment now
             // that we are leaving the GET_FILE state.
@@ -194,18 +194,19 @@
      *
      * @param line a line of text from the svn log output
      */
-    private void processGetComment(String line)
+    private void processGetComment( String line )
     {
-        if (line.equals(COMMENT_END_TOKEN))
+        if ( line.equals( COMMENT_END_TOKEN ) )
         {
-            currentLogEntry.setComment(currentComment.toString());
-            entries.add(currentLogEntry);
+            currentChange.setComment( currentComment.toString() );
+
+            entries.add( currentChange );
 
             status = GET_HEADER;
         }
         else
         {
-            currentComment.append(line).append('\n');
+            currentComment.append( line ).append( '\n' );
         }
     }
 
@@ -219,18 +220,13 @@
     {
         try
         {
-            StringBuffer date =
-                new StringBuffer()
-                    .append(headerRegexp.getParen(3))
-                    .append(" GMT")
-                    .append(headerRegexp.getParen(4))
-                    .append(headerRegexp.getParen(5))
-                    .append(':')
-                    .append(headerRegexp.getParen(6));
+            StringBuffer date = new StringBuffer().append( headerRegexp.getParen( 3 ) ).append( " GMT" )
+                .append( headerRegexp.getParen( 4 ) ).append( headerRegexp.getParen( 5 ) ).append( ':' )
+                .append( headerRegexp.getParen( 6 ) );
 
-            return SVN_TIMESTAMP.parse(date.toString());
+            return SVN_TIMESTAMP.parse( date.toString() );
         }
-        catch (ParseException e)
+        catch ( ParseException e )
         {
             return null;
         }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommandTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommandTest.java?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommandTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommandTest.java Wed Jun  8 01:37:34 2005
@@ -1,7 +1,7 @@
 package org.apache.maven.scm.provider.svn.command.changelog;
 
 /*
- * Copyright 2003-2004 The Apache Software Foundation.
+ * Copyright 2003-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,9 +22,7 @@
 import org.codehaus.plexus.util.cli.Commandline;
 
 import java.io.File;
-import java.util.Calendar;
 import java.util.Date;
-import java.util.TimeZone;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -56,7 +54,8 @@
 
         SvnScmProviderRepository svnRepository = (SvnScmProviderRepository) repository.getProviderRepository();
 
-        Commandline cl = SvnChangeLogCommand.createCommandLine( svnRepository, workingDirectory, tag, startDate, endDate );
+        Commandline cl = SvnChangeLogCommand.createCommandLine( svnRepository, workingDirectory, tag, startDate,
+                                                                endDate );
 
         assertEquals( commandLine, cl.toString() );
     }

Modified: maven/scm/trunk/maven-scm-providers/pom.xml
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/pom.xml?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/pom.xml (original)
+++ maven/scm/trunk/maven-scm-providers/pom.xml Wed Jun  8 01:37:34 2005
@@ -3,7 +3,7 @@
   <parent>
     <groupId>org.apache.maven.scm</groupId>
     <artifactId>maven-scm</artifactId>
-    <version>1.0-alpha-1</version>
+    <version>1.0-alpha-2-SNAPSHOT</version>
   </parent>
   <artifactId>maven-scm-providers</artifactId>
   <packaging>pom</packaging>
@@ -12,12 +12,12 @@
     <dependency>
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-api</artifactId>
-      <version>1.0-alpha-1</version>
+      <version>1.0-alpha-2-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-test</artifactId>
-      <version>1.0-alpha-1</version>
+      <version>1.0-alpha-2-SNAPSHOT</version>
       <scope>test</scope>
     </dependency>
   </dependencies>

Modified: maven/scm/trunk/maven-scm-test/pom.xml
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-test/pom.xml?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-test/pom.xml (original)
+++ maven/scm/trunk/maven-scm-test/pom.xml Wed Jun  8 01:37:34 2005
@@ -3,7 +3,7 @@
   <parent>
     <groupId>org.apache.maven.scm</groupId>
     <artifactId>maven-scm</artifactId>
-    <version>1.0-alpha-1</version>
+    <version>1.0-alpha-2-SNAPSHOT</version>
   </parent>
   <artifactId>maven-scm-test</artifactId>
   <name>Maven SCM Test</name>
@@ -11,7 +11,7 @@
     <dependency>
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-api</artifactId>
-      <version>1.0-alpha-1</version>
+      <version>1.0-alpha-2-SNAPSHOT</version>
     </dependency>
   </dependencies>
 </project>

Modified: maven/scm/trunk/pom.xml
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/pom.xml?rev=189558&r1=189557&r2=189558&view=diff
==============================================================================
--- maven/scm/trunk/pom.xml (original)
+++ maven/scm/trunk/pom.xml Wed Jun  8 01:37:34 2005
@@ -4,7 +4,7 @@
   <artifactId>maven-scm</artifactId>
   <name>Maven SCM</name>
   <packaging>pom</packaging>
-  <version>1.0-alpha-1</version>
+  <version>1.0-alpha-2-SNAPSHOT</version>
   <ciManagement>
     <notifiers>
       <notifier>
@@ -38,12 +38,12 @@
     <dependency>
       <groupId>plexus</groupId>
       <artifactId>plexus-container-default</artifactId>
-      <version>1.0-alpha-2</version>
+      <version>1.0-alpha-4-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-      <version>1.0-alpha-2</version>
+      <version>1.0-alpha-3</version>
     </dependency>
   </dependencies>
   <organization>



Mime
View raw message