continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r331553 - in /maven/continuum/trunk/continuum-core/src/main: java/org/apache/maven/continuum/scm/DefaultContinuumScm.java resources/META-INF/plexus/components.xml
Date Mon, 07 Nov 2005 17:36:42 GMT
Author: evenisse
Date: Mon Nov  7 09:36:33 2005
New Revision: 331553

URL: http://svn.apache.org/viewcvs?rev=331553&view=rev
Log:
Define the last update date in update command for getting only changes since this date in
scmresult

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
    maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java?rev=331553&r1=331552&r2=331553&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
Mon Nov  7 09:36:33 2005
@@ -17,9 +17,11 @@
  */
 
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.scm.ChangeFile;
 import org.apache.maven.continuum.model.scm.ChangeSet;
 import org.apache.maven.continuum.model.scm.ScmResult;
+import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFile;
@@ -36,6 +38,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 
@@ -57,6 +60,11 @@
      */
     private WorkingDirectoryService workingDirectoryService;
 
+    /**
+     * @plexus.requirement
+     */
+    private ContinuumStore store;
+
     // ----------------------------------------------------------------------
     // ContinuumScm implementation
     // ----------------------------------------------------------------------
@@ -200,7 +208,7 @@
             synchronized ( this )
             {
                 result = convertScmResult(
-                    scmManager.getProviderByRepository( repository ).update( repository,
fileSet, tag ) );
+                    scmManager.getProviderByRepository( repository ).update( repository,
fileSet, tag, getLatestUpdateDate( project ) ) );
             }
 
             if ( !result.isSuccess() )
@@ -235,6 +243,21 @@
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
+
+    private Date getLatestUpdateDate( Project project )
+    {
+        try
+        {
+            BuildResult result = store.getLatestBuildResultForProject( project.getId() );
+
+            return new Date( result.getStartTime() );
+        }
+        catch ( Exception e )
+        {
+        }
+
+        return null;
+    }
 
     private ScmRepository getScmRepositorty( Project project )
         throws ScmRepositoryException, NoSuchScmProviderException

Modified: maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=331553&r1=331552&r2=331553&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
Mon Nov  7 09:36:33 2005
@@ -154,6 +154,9 @@
         <requirement>
           <role>org.apache.maven.continuum.utils.WorkingDirectoryService</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.continuum.store.ContinuumStore</role>
+        </requirement>
       </requirements>
     </component>
 



Mime
View raw message