continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r388590 - in /maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum: buildcontroller/DefaultBuildController.java core/action/AbstractContinuumAction.java core/action/ExecuteBuilderContinuumAction.java
Date Fri, 24 Mar 2006 17:53:37 GMT
Author: evenisse
Date: Fri Mar 24 09:53:34 2006
New Revision: 388590

URL: http://svn.apache.org/viewcvs?rev=388590&view=rev
Log:
[CONTINUUM-637] Fix build when two build definition are on the same schedule for a project
and fix the merge between new scm result and other since last execution

Modified:
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java

Modified: maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=388590&r1=388589&r2=388590&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
Fri Mar 24 09:53:34 2006
@@ -150,6 +150,8 @@
 
             actionContext.put( AbstractContinuumAction.KEY_TRIGGER, new Integer( trigger
) );
 
+            actionContext.put( AbstractContinuumAction.KEY_FIRST_RUN, Boolean.valueOf( oldBuildResult
== null ) );
+
             ScmResult scmResult = null;
 
             try
@@ -179,6 +181,9 @@
                 // Check to see if there was a error while checking out/updating the project
                 // ----------------------------------------------------------------------
 
+                // Merge scm results so we'll have all changes since last execution of current
build definition
+                scmResult = mergeScmResults( oldScmResult, scmResult );
+
                 if ( scmResult == null || !scmResult.isSuccess() )
                 {
                     // scmResult must be converted before sotring it because jpox modify
value of all fields to null
@@ -199,9 +204,6 @@
                     return;
                 }
 
-                // Merge scm results so we'll have all changes since last execution of current
build definition
-                scmResult = mergeScmResults( oldScmResult, scmResult );
-
                 actionContext.put( AbstractContinuumAction.KEY_UPDATE_SCM_RESULT, scmResult
);
 
                 List changes = scmResult.getChanges();
@@ -243,7 +245,8 @@
                     }
                 }
 
-                if ( allChangesUnknown && project.getOldState() != ContinuumProjectState.NEW
&&
+                if ( oldBuildResult != null && allChangesUnknown &&
+                    project.getOldState() != ContinuumProjectState.NEW &&
                     project.getOldState() != ContinuumProjectState.CHECKEDOUT &&
                     trigger != ContinuumProjectState.TRIGGER_FORCED &&
                     project.getState() != ContinuumProjectState.NEW &&
@@ -466,6 +469,11 @@
                         {
                             ChangeSet changeSet = (ChangeSet) j.next();
 
+                            if ( changeSet.getDate() < fromDate )
+                            {
+                                continue;
+                            }
+
                             if ( !res.getChanges().contains( changeSet ) )
                             {
                                 res.addChange( changeSet );
@@ -483,6 +491,11 @@
     {
         if ( oldScmResult != null )
         {
+            if ( newScmResult == null )
+            {
+                return oldScmResult;
+            }
+
             List oldChanges = oldScmResult.getChanges();
 
             List newChanges = newScmResult.getChanges();

Modified: maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java?rev=388590&r1=388589&r2=388590&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
Fri Mar 24 09:53:34 2006
@@ -63,6 +63,8 @@
 
     public static final String KEY_TRIGGER = "trigger";
 
+    public static final String KEY_FIRST_RUN = "first-run";
+
     // ----------------------------------------------------------------------
     // Utils
     // ----------------------------------------------------------------------

Modified: maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java?rev=388590&r1=388589&r2=388590&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
Fri Mar 24 09:53:34 2006
@@ -69,17 +69,21 @@
 
         Project project = getProject( context );
 
+        BuildDefinition buildDefinition = getBuildDefinition( context );
+
         int trigger = getTrigger( context );
 
         ScmResult scmResult = getUpdateScmResult( context );
 
+        boolean isFirstRun = ( (Boolean) context.get( AbstractContinuumAction.KEY_FIRST_RUN
) ).booleanValue();
+
         ContinuumBuildExecutor buildExecutor = buildExecutorManager.getBuildExecutor( project.getExecutorId()
);
 
         // ----------------------------------------------------------------------
         // This is really a precondition for this action to execute
         // ----------------------------------------------------------------------
 
-        if ( project.getOldState() != ContinuumProjectState.NEW &&
+        if ( !isFirstRun && project.getOldState() != ContinuumProjectState.NEW &&
             project.getOldState() != ContinuumProjectState.CHECKEDOUT && scmResult.getChanges().size()
== 0 &&
             trigger != ContinuumProjectState.TRIGGER_FORCED && !isNew( project )
)
         {
@@ -105,8 +109,6 @@
         build.setState( ContinuumProjectState.BUILDING );
 
         build.setTrigger( trigger );
-
-        BuildDefinition buildDefinition = store.getBuildDefinition( getBuildDefinitionId(
context ) );
 
         build.setScmResult( scmResult );
 



Mime
View raw message