continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r781657 - /continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Date Thu, 04 Jun 2009 06:36:11 GMT
Author: ctan
Date: Thu Jun  4 06:36:11 2009
New Revision: 781657

URL: http://svn.apache.org/viewvc?rev=781657&view=rev
Log:
[CONTINUUM-2253] use same scm root url for multi-module projects in a group

Modified:
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=781657&r1=781656&r2=781657&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Thu Jun  4 06:36:11 2009
@@ -1428,7 +1428,24 @@
         Map<String, Object> context = new HashMap<String, Object>();
 
         String scmUrl = project.getScmUrl();
-        createProjectScmRoot( projectGroup, scmUrl );
+
+        List<ProjectScmRoot> scmRoots = getProjectScmRootByProjectGroup( groupId );
+
+        boolean found = false;
+
+        for ( ProjectScmRoot scmRoot : scmRoots )
+        {
+            if ( scmUrl.startsWith( scmRoot.getScmRootAddress() ) )
+            {
+                found = true;
+                break;
+            }
+        }
+
+        if ( !found )
+        {
+            createProjectScmRoot( projectGroup, scmUrl );
+        }
 
         // ----------------------------------------------------------------------
         //
@@ -1599,8 +1616,6 @@
 
         ProjectGroup projectGroup = result.getProjectGroups().iterator().next();
 
-        ProjectScmRoot projectScmRoot;
-
         boolean projectGroupCreation = false;
 
         try
@@ -1639,9 +1654,20 @@
 
             String url = CreateProjectsFromMetadataAction.getUrl( context );
 
-            projectScmRoot = getProjectScmRootByProjectGroupAndScmRootAddress( projectGroup.getId(),
url );
+            List<ProjectScmRoot> scmRoots = getProjectScmRootByProjectGroup( projectGroup.getId()
);
+
+            boolean found = false;
+
+            for ( ProjectScmRoot scmRoot : scmRoots )
+            {
+                if ( url.startsWith( scmRoot.getScmRootAddress() ) )
+                {
+                    found = true;
+                    break;
+                }
+            }
 
-            if ( projectScmRoot == null )
+            if ( !found )
             {
                 createProjectScmRoot( projectGroup, url );
             }



Mime
View raw message