continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1091054 - in /continuum/trunk: ./ continuum-release/ continuum-release/src/main/java/org/apache/continuum/release/phase/ continuum-release/src/main/java/org/apache/maven/continuum/release/phase/
Date Mon, 11 Apr 2011 12:58:12 GMT
Author: batkinson
Date: Mon Apr 11 12:58:12 2011
New Revision: 1091054

URL: http://svn.apache.org/viewvc?rev=1091054&view=rev
Log:
[CONTINUUM-2591] Git builds can't properly release or checkout on branch
Updated git-scm to include fixes required for proper checkout on a branch. Updated the release
manager, and added a workaround for detecting current branch from working copy for releases
to work properly.

Modified:
    continuum/trunk/continuum-release/pom.xml
    continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/phase/RunPrepareGoalsPhase.java
    continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhase.java
    continuum/trunk/pom.xml

Modified: continuum/trunk/continuum-release/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/pom.xml?rev=1091054&r1=1091053&r2=1091054&view=diff
==============================================================================
--- continuum/trunk/continuum-release/pom.xml (original)
+++ continuum/trunk/continuum-release/pom.xml Mon Apr 11 12:58:12 2011
@@ -90,6 +90,12 @@ under the License.
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-provider-gitexe</artifactId>
+      <version>1.4</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-component-api</artifactId>
     </dependency>
@@ -105,6 +111,11 @@ under the License.
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-api</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-manager-plexus</artifactId>
+      <scope>compile</scope>
+    </dependency>
     <!-- === Testing Dependencies === -->
     <dependency>
       <groupId>hsqldb</groupId>

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/phase/RunPrepareGoalsPhase.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/phase/RunPrepareGoalsPhase.java?rev=1091054&r1=1091053&r2=1091054&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/phase/RunPrepareGoalsPhase.java
(original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/phase/RunPrepareGoalsPhase.java
Mon Apr 11 12:58:12 2011
@@ -22,7 +22,6 @@ package org.apache.continuum.release.pha
 import java.io.File;
 import java.util.List;
 
-import org.apache.maven.settings.Settings;
 import org.apache.maven.shared.release.ReleaseExecutionException;
 import org.apache.maven.shared.release.ReleaseFailureException;
 import org.apache.maven.shared.release.ReleaseResult;
@@ -50,7 +49,8 @@ public class RunPrepareGoalsPhase
                 releaseDescriptor.getAdditionalArguments() );
 	}
 
-    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings,
List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment
releaseEnvironment,
+                                   List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         ReleaseResult result = new ReleaseResult();
@@ -58,7 +58,7 @@ public class RunPrepareGoalsPhase
         logInfo( result, "Executing preparation goals - since this is simulation mode it
is running against the " +
             "original project, not the rewritten ones" );
 
-        execute( releaseDescriptor, settings, reactorProjects );
+        execute( releaseDescriptor, releaseEnvironment, reactorProjects );
 
         return result;
     }

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhase.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhase.java?rev=1091054&r1=1091053&r2=1091054&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhase.java
(original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhase.java
Mon Apr 11 12:58:12 2011
@@ -19,13 +19,21 @@ package org.apache.maven.continuum.relea
  * under the License.
  */
 
+import java.io.File;
+import java.util.List;
+
+import org.apache.maven.scm.ScmBranch;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmVersion;
 import org.apache.maven.scm.command.checkout.CheckOutScmResult;
 import org.apache.maven.scm.command.update.UpdateScmResult;
 import org.apache.maven.scm.manager.NoSuchScmProviderException;
+import org.apache.maven.scm.manager.plexus.PlexusLogger;
 import org.apache.maven.scm.provider.ScmProvider;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.git.gitexe.command.branch.GitBranchCommand;
+import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository;
 import org.apache.maven.scm.repository.ScmRepository;
 import org.apache.maven.scm.repository.ScmRepositoryException;
 import org.apache.maven.settings.Settings;
@@ -39,9 +47,6 @@ import org.apache.maven.shared.release.s
 import org.apache.maven.shared.release.scm.ReleaseScmRepositoryException;
 import org.apache.maven.shared.release.scm.ScmRepositoryConfigurator;
 
-import java.io.File;
-import java.util.List;
-
 /**
  * Update working copy
  *
@@ -87,6 +92,7 @@ public class UpdateWorkingCopyPhase
         CheckOutScmResult checkOutScmResult = null;
         
         File workingDirectory = new File( releaseDescriptor.getWorkingDirectory() );
+        ScmFileSet workingDirSet = new ScmFileSet( workingDirectory );
         
         try
         {
@@ -95,13 +101,27 @@ public class UpdateWorkingCopyPhase
                 workingDirectory.mkdirs();
             }
             
+            ScmVersion scmTag = null;
+
+            ScmProviderRepository providerRepo = repository.getProviderRepository();
+
+            // FIXME: This should be handled by the maven-scm git provider
+            if ( providerRepo instanceof GitScmProviderRepository )
+            {
+                String branchName =
+                    GitBranchCommand.getCurrentBranch( new PlexusLogger(getLogger()), (GitScmProviderRepository)
providerRepo,
+                                                       workingDirSet );
+                scmTag = new ScmBranch( branchName );
+            }
+
             if( workingDirectory.listFiles().length > 1 )
             {
-                updateScmResult = provider.update( repository, new ScmFileSet( workingDirectory
), (ScmVersion) null );
+                updateScmResult = provider.update( repository, workingDirSet, scmTag );
             }
             else
             {
                 checkOutScmResult = provider.checkOut( repository, new ScmFileSet( workingDirectory
) );
+                checkOutScmResult = provider.checkOut( repository, workingDirSet, scmTag
);
             }
         }
         catch ( ScmException e )

Modified: continuum/trunk/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/pom.xml?rev=1091054&r1=1091053&r2=1091054&view=diff
==============================================================================
--- continuum/trunk/pom.xml (original)
+++ continuum/trunk/pom.xml Mon Apr 11 12:58:12 2011
@@ -544,7 +544,7 @@ under the License.
       <dependency>
         <groupId>org.apache.maven.release</groupId>
         <artifactId>maven-release-manager</artifactId>
-        <version>2.0</version>
+        <version>2.1</version>
         <exclusions>
           <exclusion>
             <groupId>commons-logging</groupId>
@@ -1696,7 +1696,7 @@ under the License.
     <spring.version>2.5.6</spring.version>
     <struts.version>2.1.6</struts.version>
     <wagon.version>1.0-beta-2</wagon.version>
-    <maven-scm.version>1.2</maven-scm.version>
+    <maven-scm.version>1.4</maven-scm.version>
     <redback.version>1.3-SNAPSHOT</redback.version>
     <archiva.version>1.2.1</archiva.version>
     <slf4jVersion>1.5.8</slf4jVersion>



Mime
View raw message