continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From epunza...@apache.org
Subject svn commit: r507397 - in /maven/continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/scm/ continuum-model/src/main/mdo/ continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ continuum-webapp/src/main/resources/locali...
Date Wed, 14 Feb 2007 05:49:09 GMT
Author: epunzalan
Date: Tue Feb 13 21:49:08 2007
New Revision: 507397

URL: http://svn.apache.org/viewvc?view=rev&rev=507397
Log:
[CONTINUUM-1155]

added configuration to force the use of scm cache... currently leaning towards the use of
svn cache while cvs cache is always used when available

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
    maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectEdit.jsp

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java?view=diff&rev=507397&r1=507396&r2=507397
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
Tue Feb 13 21:49:08 2007
@@ -102,7 +102,7 @@
             getLogger().info( "Checking out project: '" + project.getName() + "', " + "id:
'" + project.getId() + "' " +
                 "to '" + workingDirectory + "'" + tagMessage + "." );
 
-            ScmRepository repository = getScmRepositorty( project );
+            ScmRepository repository = getScmRepositorty( project, false );
 
             ScmResult result;
 
@@ -232,7 +232,7 @@
                 }
             }
 
-            ScmRepository repository = getScmRepositorty( project );
+            ScmRepository repository = getScmRepositorty( project, project.isScmUseCache()
);
 
             ScmResult result;
 
@@ -320,24 +320,27 @@
         return null;
     }
 
-    private ScmRepository getScmRepositorty( Project project )
+    private ScmRepository getScmRepositorty( Project project, boolean useCredentialsCache
)
         throws ScmRepositoryException, NoSuchScmProviderException
     {
         ScmRepository repository = scmManager.makeScmRepository( project.getScmUrl().trim()
);
 
         repository.getProviderRepository().setPersistCheckout( true );
 
-        if ( !StringUtils.isEmpty( project.getScmUsername() ) )
+        if ( !( useCredentialsCache && repository.getProvider().equals( "svn" ) )
)
         {
-            repository.getProviderRepository().setUser( project.getScmUsername() );
-
-            if ( !StringUtils.isEmpty( project.getScmPassword() ) )
+            if ( !StringUtils.isEmpty( project.getScmUsername() ) )
             {
-                repository.getProviderRepository().setPassword( project.getScmPassword()
);
-            }
-            else
-            {
-                repository.getProviderRepository().setPassword( "" );
+                repository.getProviderRepository().setUser( project.getScmUsername() );
+
+                if ( !StringUtils.isEmpty( project.getScmPassword() ) )
+                {
+                    repository.getProviderRepository().setPassword( project.getScmPassword()
);
+                }
+                else
+                {
+                    repository.getProviderRepository().setPassword( "" );
+                }
             }
         }
 

Modified: maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml?view=diff&rev=507397&r1=507396&r2=507397
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml (original)
+++ maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml Tue Feb 13 21:49:08 2007
@@ -191,6 +191,11 @@
           <type>String</type>
         </field>
         <field>
+          <name>scmUseCache</name>
+          <version>1.1.0+</version>
+          <type>boolean</type>
+        </field>
+        <field>
           <name>version</name>
           <version>1.1.0+</version>
           <type>String</type>

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java?view=diff&rev=507397&r1=507396&r2=507397
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
Tue Feb 13 21:49:08 2007
@@ -50,6 +50,8 @@
 
     private String scmTag;
 
+    private boolean scmUseCache;
+
     public String save()
         throws ContinuumException
     {
@@ -61,6 +63,8 @@
 
         project.setScmUrl( scmUrl );
 
+        project.setScmUseCache( scmUseCache );
+
         project.setScmUsername( scmUsername );
 
         project.setScmPassword( scmPassword );
@@ -87,6 +91,8 @@
 
         scmPassword = project.getScmPassword();
 
+        scmUseCache = project.isScmUseCache();
+
         scmTag = project.getScmTag();
 
         return SUCCESS;
@@ -171,5 +177,15 @@
     public Project getProject()
     {
         return project;
+    }
+
+    public void setScmUseCache( boolean scmUseCache )
+    {
+        this.scmUseCache = scmUseCache;
+    }
+
+    public boolean isScmUseCache()
+    {
+        return scmUseCache;
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?view=diff&rev=507397&r1=507396&r2=507397
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Tue Feb 13 21:49:08 2007
@@ -315,10 +315,11 @@
 projectEdit.section.title = Update Continuum Project
 projectEdit.project.name.label = Project Name
 projectEdit.project.version.label = Version
-projectEdit.project.scmUrl.label = Scm Url
-projectEdit.project.scmUsername.label = Scm Username
-projectEdit.project.scmPassword.label = Scm Password
-projectEdit.project.scmTag.label = Scm Branch/Tag
+projectEdit.project.scmUrl.label = SCM Url
+projectEdit.project.scmUsername.label = SCM Username
+projectEdit.project.scmPassword.label = SCM Password
+projectEdit.project.scmUseCache.label = Use SCM Credentials Cache, if available
+projectEdit.project.scmTag.label = SCM Branch/Tag
 
 # ----------------------------------------------------------------------
 # Page: BuildDefinitionEdit
@@ -431,14 +432,14 @@
 buildResult.trigger.0 = Scheduled
 buildResult.trigger.1 = Forced
 buildResult.state.1 = New
-buildResult.state.2 = OK 
+buildResult.state.2 = OK
 buildResult.state.3 = Failed
-buildResult.state.4 = Error 
-buildResult.state.6 = Building 
-buildResult.state.7 = Checking out 
-buildResult.state.8 = Updating 
-buildResult.state.9 = Warning 
-buildResult.state.10 = Checked out 
+buildResult.state.4 = Error
+buildResult.state.6 = Building
+buildResult.state.7 = Checking out
+buildResult.state.8 = Updating
+buildResult.state.9 = Warning
+buildResult.state.10 = Checked out
 
 # ----------------------------------------------------------------------
 # Page: WorkingCopy

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectEdit.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectEdit.jsp?view=diff&rev=507397&r1=507396&r2=507397
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectEdit.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectEdit.jsp Tue
Feb 13 21:49:08 2007
@@ -22,19 +22,46 @@
 <html>
   <ww:i18n name="localization.Continuum">
     <head>
-        <title><ww:text name="projectEdit.page.title"/></title>
+      <title><ww:text name="projectEdit.page.title"/></title>
+      <script type="text/javascript">
+        function focus()
+        {
+          checkUseCache();
+        }
+
+        function checkUseCache()
+        {
+          var form = document.forms[ "editProject" ];
+
+          if ( form.scmUrl.value.toLowerCase().indexOf( "scm:svn:" ) == 0 )
+          {
+            form.scmUseCache.disabled = false;
+            form.scmUsername.disabled = form.scmUseCache.checked;
+            form.scmPassword.disabled = form.scmUseCache.checked;
+          }
+          else
+          {
+            form.scmUseCache.disabled = true;
+            form.scmUsername.disabled = false;
+            form.scmPassword.disabled = false;
+          }
+        }
+      </script>
     </head>
     <body>
       <div id="axial" class="h3">
         <h3><ww:text name="projectEdit.section.title"/></h3>
 
         <div class="axial">
-          <ww:form action="projectSave" method="post" validate="true">
+          <ww:form name="editProject" action="projectSave" method="post" validate="true">
             <table>
               <tbody>
                 <ww:textfield label="%{getText('projectEdit.project.name.label')}" name="name"
required="true"/>
                 <ww:textfield label="%{getText('projectEdit.project.version.label')}"
name="version" required="true"/>
-                <ww:textfield label="%{getText('projectEdit.project.scmUrl.label')}" name="scmUrl"
required="true"/>
+                <ww:textfield label="%{getText('projectEdit.project.scmUrl.label')}" name="scmUrl"
required="true"
+                             onchange="checkUseCache()"/>
+                <ww:checkbox label="%{getText('projectEdit.project.scmUseCache.label')}"
name="scmUseCache"
+                             onclick="checkUseCache()"/>
                 <ww:textfield label="%{getText('projectEdit.project.scmUsername.label')}"
name="scmUsername"/>
                 <ww:password label="%{getText('projectEdit.project.scmPassword.label')}"
name="scmPassword"/>
                 <ww:textfield label="%{getText('projectEdit.project.scmTag.label')}" name="scmTag"/>
@@ -49,4 +76,4 @@
       </div>
     </body>
   </ww:i18n>
-</html>
+</html>
\ No newline at end of file



Mime
View raw message