maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r374388 - in /maven/scm/trunk/maven-scm-providers: ./ maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/
Date Thu, 02 Feb 2006 14:00:52 GMT
Author: evenisse
Date: Thu Feb  2 06:00:46 2006
New Revision: 374388

URL: http://svn.apache.org/viewcvs?rev=374388&view=rev
Log:
Fix Vss provider with new API

Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssChangeLogConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssHistoryCommand.java
    maven/scm/trunk/maven-scm-providers/pom.xml

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssChangeLogConsumer.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssChangeLogConsumer.java?rev=374388&r1=374387&r2=374388&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssChangeLogConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssChangeLogConsumer.java
Thu Feb  2 06:00:46 2006
@@ -20,13 +20,11 @@
 import org.apache.maven.scm.ChangeSet;
 import org.apache.maven.scm.log.ScmLogger;
 import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository;
-import org.codehaus.plexus.util.cli.StreamConsumer;
+import org.apache.maven.scm.util.AbstractConsumer;
 
-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;
@@ -37,7 +35,7 @@
  * @version $Id$
  */
 public class VssChangeLogConsumer
-    implements StreamConsumer
+    extends AbstractConsumer
 {
     /**
      * Custom date/time formatter. Rounds ChangeLogEntry times to the nearest
@@ -107,23 +105,24 @@
      */
     private Map entries = new TreeMap( Collections.reverseOrder() );
 
-    ChangeFile currentFile;
+    private ChangeFile currentFile;
 
-    ChangeSet currentChangeSet;
+    private ChangeSet currentChangeSet;
 
     /**
      * last status of the parser
      */
     private int lastStatus = GET_FILE;
 
-    VssScmProviderRepository repo;
+    private VssScmProviderRepository repo;
 
-    ScmLogger logger;
+    private String userDatePattern;
 
-    public VssChangeLogConsumer( VssScmProviderRepository repo, ScmLogger logger )
+    public VssChangeLogConsumer( VssScmProviderRepository repo, String userDatePattern, ScmLogger
logger )
     {
+        super( logger );
+        this.userDatePattern = userDatePattern;
         this.repo = repo;
-        this.logger = logger;
     }
 
     public List getModifications()
@@ -193,7 +192,8 @@
             }
         }
         currentChangeSet.setAuthor( (String) vector.get( 1 ) );
-        currentChangeSet.setDate( parseDate( vector.get( 3 ) + " " + vector.get( 5 ) ) );
+        currentChangeSet.setDate(
+            parseDate( vector.get( 3 ) + " " + vector.get( 5 ), userDatePattern, "dd.MM.yy
HH:mm" ) );
     }
 
     /**
@@ -305,25 +305,6 @@
         {
             ChangeSet existingEntry = (ChangeSet) entries.get( key );
             existingEntry.addFile( file );
-        }
-    }
-
-    /**
-     * Converts the date timestamp from the svn output into a date object.
-     *
-     * @return A date representing the timestamp of the log entry.
-     */
-    private Date parseDate( String dateString )
-    {
-        try
-        {
-            SimpleDateFormat format = new SimpleDateFormat( "dd.MM.yy HH:mm" );
-            return format.parse( dateString );
-        }
-        catch ( ParseException e )
-        {
-            logger.error( "ParseException Caught", e );
-            return null;
         }
     }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssHistoryCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssHistoryCommand.java?rev=374388&r1=374387&r2=374388&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssHistoryCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssHistoryCommand.java
Thu Feb  2 06:00:46 2006
@@ -72,14 +72,15 @@
     }
 
     protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repository,
ScmFileSet fileSet,
-                                                          Date startDate, Date endDate, String
branch )
+                                                          Date startDate, Date endDate, String
branch,
+                                                          String datePattern )
         throws ScmException
     {
         VssScmProviderRepository repo = (VssScmProviderRepository) repository;
 
         Commandline cl = buildCmdLine( repo, fileSet, startDate, endDate );
 
-        VssChangeLogConsumer consumer = new VssChangeLogConsumer( repo, getLogger() );
+        VssChangeLogConsumer consumer = new VssChangeLogConsumer( repo, datePattern, getLogger()
);
 
         CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
 

Modified: maven/scm/trunk/maven-scm-providers/pom.xml
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/pom.xml?rev=374388&r1=374387&r2=374388&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/pom.xml (original)
+++ maven/scm/trunk/maven-scm-providers/pom.xml Thu Feb  2 06:00:46 2006
@@ -17,6 +17,7 @@
     <module>maven-scm-provider-perforce</module>
     <module>maven-scm-provider-starteam</module>
     <module>maven-scm-provider-svn</module>
+    <module>maven-scm-provider-vss</module>
   </modules>
   <dependencies>
     <dependency>



Mime
View raw message