continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r291648 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-web/src/main/resources/templates/screens/
Date Mon, 26 Sep 2005 16:05:29 GMT
Author: evenisse
Date: Mon Sep 26 09:05:21 2005
New Revision: 291648

URL: http://svn.apache.org/viewcvs?rev=291648&view=rev
Log:
[CONTINUUM-117] Blame mechanism

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=291648&r1=291647&r2=291648&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
Mon Sep 26 09:05:21 2005
@@ -102,6 +102,9 @@
     Collection getBuildResultsForProject( int projectId )
         throws ContinuumException;
 
+    List getChangesSinceLastSuccess( int projectId, int buildResultId )
+        throws ContinuumException;
+
     // ----------------------------------------------------------------------
     // Projects
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=291648&r1=291647&r2=291648&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Mon Sep 26 09:05:21 2005
@@ -335,6 +335,72 @@
         }
     }
 
+    public List getChangesSinceLastSuccess( int projectId, int buildResultId )
+        throws ContinuumException
+    {
+        ArrayList buildResults = null;
+
+        try
+        {
+            buildResults = new ArrayList( store.getProjectWithBuilds( projectId ).getBuildResults()
);
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw logAndCreateException( "Exception while getting build results for project.",
e );
+        }
+
+        Collections.reverse( buildResults );
+
+        Iterator buildResultsIterator = buildResults.iterator();
+
+        boolean stop = false;
+
+        while( !stop )
+        {
+            if ( buildResultsIterator.hasNext() )
+            {
+                BuildResult buildResult = (BuildResult) buildResultsIterator.next();
+
+                if ( buildResult.getId() == buildResultId )
+                {
+                    stop = true;
+                }
+            }
+            else
+            {
+                stop = true;
+            }
+        }
+
+        if ( !buildResultsIterator.hasNext() )
+        {
+            return null;
+        }
+
+        BuildResult buildResult = (BuildResult) buildResultsIterator.next();
+
+        List changes = null;
+
+        while (  buildResult.getState() != ContinuumProjectState.OK )
+        {
+            if ( changes == null )
+            {
+                changes = new ArrayList();
+            }
+
+            changes.addAll( buildResult.getScmResult().getChanges() );
+
+            if ( !buildResultsIterator.hasNext() )
+            {
+                return changes;
+            }
+
+            buildResult = (BuildResult) buildResultsIterator.next();
+        }
+
+        return changes;
+    }
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm?rev=291648&r1=291647&r2=291648&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
Mon Sep 26 09:05:21 2005
@@ -62,6 +62,27 @@
   </p>
   #end
 
+  #set ( $changeSets = $continuum.getChangesSinceLastSuccess( $id, $build.id ) )
+  #if ( $changeSets )
+  <h4>Other Changes Since Last Success</h4>
+  <p>
+    <table border="1" cellspacing="2" cellpadding="3" width="100%">
+      #foreach ( $changeSet in $changeSets )
+      <tr class="a">
+        #if ($changeSet.author) <td>$changeSet.author</td> #end
+        #if ($changeSet.date > 0) <td>$date.format('medium',$changeSet.date)</td>
#end
+        #if ($changeSet.comment) <td>$changeSet.comment</td> #end
+        <td>
+          #foreach ( $file in $changeSet.files )
+            <code>$!file.name</code><br/>
+          #end
+        </td>
+      </tr>
+      #end
+    </table>
+  </p>
+  #end
+
 #if ( $build.state == 4 )
   <h4>Build Error</h4>
   <p>



Mime
View raw message