continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wsm...@apache.org
Subject svn commit: r655356 - /continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
Date Sun, 11 May 2008 18:43:36 GMT
Author: wsmoak
Date: Sun May 11 11:43:36 2008
New Revision: 655356

URL: http://svn.apache.org/viewvc?rev=655356&view=rev
Log:
[CONTINUUM-1515] For release preparation, default the scm tag to $artifactId-$version, minus
the -SNAPSHOT suffix if present. 
(If the project has configured the release plugin with a tag name, that will be used instead.)
Submitted by: Maria Catherine Tan

Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java?rev=655356&r1=655355&r2=655356&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
Sun May 11 11:43:36 2008
@@ -52,6 +52,8 @@
     extends ContinuumActionSupport
 {
     private static final String SCM_SVN_PROTOCOL_PREFIX = "scm:svn";
+    
+    private static final String SNAPSHOT_VERSION_SUFFIX = "-SNAPSHOT";
 
     private int projectId;
 
@@ -99,6 +101,23 @@
         scmUsername = project.getScmUsername();
         scmPassword = project.getScmPassword();
         scmTag = project.getScmTag();
+        
+        if ( scmTag == null )
+        {
+            String version = project.getVersion();
+            int idx = version.indexOf( SNAPSHOT_VERSION_SUFFIX );
+            
+            if ( idx >= 0 )
+            {
+                // strip the snapshot version suffix
+                scmTag = project.getArtifactId() + "-" + version.substring( 0, idx );
+            }
+            else
+            {
+                scmTag = project.getArtifactId() + "-" + version;
+            }
+        }
+        
         String workingDirectory = getContinuum().getWorkingDirectory( project.getId() ).getPath();
 
         String scmUrl = project.getScmUrl();



Mime
View raw message