maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r540587 - in /maven/scm/trunk: maven-scm-api/src/main/java/org/apache/maven/scm/manager/ maven-scm-test/src/main/java/org/apache/maven/scm/manager/
Date Tue, 22 May 2007 14:00:14 GMT
Author: evenisse
Date: Tue May 22 07:00:13 2007
New Revision: 540587

URL: http://svn.apache.org/viewvc?view=rev&rev=540587
Log:
Allow to change the provider implementation by API instead of using a system property

Modified:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java?view=diff&rev=540587&r1=540586&r2=540587
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java
(original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java
Tue May 22 07:00:13 2007
@@ -66,6 +66,8 @@
 
     private ScmLogger logger;
 
+    private Map userProviderTypes = new HashMap();
+
     protected void setScmProviders( Map/*<String,ScmProvider>*/ providers )
     {
         this.scmProviders = providers;
@@ -110,6 +112,11 @@
         return getProviderByType( providerType );
     }
 
+    public void setScmProviderImplementation( String providerType, String providerImplementation
)
+    {
+        userProviderTypes.put( providerType, providerImplementation );
+    }
+
     public ScmProvider getProviderByType( String providerType )
         throws NoSuchScmProviderException
     {
@@ -131,7 +138,14 @@
 
         if ( usedProviderType == null )
         {
-            usedProviderType = providerType;
+            if ( userProviderTypes.containsKey( providerType ) )
+            {
+                usedProviderType = (String) userProviderTypes.get( providerType );
+            }
+            else
+            {
+                usedProviderType = providerType;
+            }
         }
 
         ScmProvider scmProvider = (ScmProvider) scmProviders.get( usedProviderType );

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java?view=diff&rev=540587&r1=540586&r2=540587
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java
(original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java
Tue May 22 07:00:13 2007
@@ -110,6 +110,14 @@
     void setScmProvider( String providerType, ScmProvider provider );
 
     /**
+     * Set the provider implementation
+     *
+     * @param providerType           The provider type, eg. <code>cvs</code>
+     * @param providerImplementation The provider implementation (the role-hint of the provider),
eg. <code>cvs</code>, <code>cvs_native</code>
+     */
+    void setScmProviderImplementation( String providerType, String providerImplementation
);
+
+    /**
      * Adds the given files to the source control system
      *
      * @param repository the source control system

Modified: maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java?view=diff&rev=540587&r1=540586&r2=540587
==============================================================================
--- maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java
(original)
+++ maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java
Tue May 22 07:00:13 2007
@@ -91,6 +91,11 @@
         setScmProvider( provider );
     }
 
+    public void setScmProviderImplementation( String providerType, String providerImplementation
)
+    {
+        //Do nothing there
+    }
+
     public void setScmRepository( ScmRepository scmRepository )
     {
         this.scmRepository = scmRepository;



Mime
View raw message