maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1306403 - in /maven/scm/trunk: maven-scm-api/src/main/java/org/apache/maven/scm/ maven-scm-api/src/main/java/org/apache/maven/scm/provider/ maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/...
Date Wed, 28 Mar 2012 15:13:37 GMT
Author: olamy
Date: Wed Mar 28 15:13:37 2012
New Revision: 1306403

URL: http://svn.apache.org/viewvc?rev=1306403&view=rev
Log:
expose add method with CommandParameters parameter and add a new CommandParameter to force
add

Modified:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/IntegrityScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/PerforceScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/TfsScmProvider.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/ScmTckTestCase.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java?rev=1306403&r1=1306402&r2=1306403&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java
(original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java
Wed Mar 28 15:13:37 2012
@@ -80,6 +80,13 @@ public class CommandParameter
      */
     public static final CommandParameter SCM_SHORT_REVISION_LENGTH = new CommandParameter(
"shortRevisionLength" );
 
+    /**
+     * Parameter to force add
+     *
+     * @since 1.7
+     */
+    public static final CommandParameter FORCE_ADD = new CommandParameter( "forceAdd" );
+
 
     /**
      * Parameter name

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java?rev=1306403&r1=1306402&r2=1306403&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java
Wed Mar 28 15:13:37 2012
@@ -160,7 +160,19 @@ public abstract class AbstractScmProvide
         return add( repository.getProviderRepository(), fileSet, parameters );
     }
 
-    protected AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
+    public AddScmResult add( ScmRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
+        throws ScmException
+    {
+        login( repository, fileSet );
+
+        // TODO: binary may be dependant on particular files though
+        // TODO: set boolean?
+        parameters.setString( CommandParameter.BINARY, "false" );
+
+        return add( repository.getProviderRepository(), fileSet, parameters );
+    }
+
+    public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
         throws ScmException
     {
         throw new NoSuchCommandScmException( "add" );

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java?rev=1306403&r1=1306402&r2=1306403&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java
Wed Mar 28 15:13:37 2012
@@ -134,6 +134,18 @@ public interface ScmProvider
         throws ScmException;
 
     /**
+     * Adds the given files to the source control system
+     *
+     * @param repository        the source control system
+     * @param fileSet           the files to be added
+     * @param commandParameters {@link CommandParameters}
+     * @return an {@link AddScmResult} that contains the files that have been added
+     * @throws ScmException if any
+     */
+    AddScmResult add( ScmRepository repository, ScmFileSet fileSet, CommandParameters commandParameters
)
+        throws ScmException;
+
+    /**
      * Branch (or label in some systems) will create a branch of the source file with a certain
branch name
      *
      * @param repository the source control system
@@ -878,7 +890,6 @@ public interface ScmProvider
         throws ScmException;
 
     /**
-     *
      * @param repository the source control system
      * @param fileSet    not use currently but for future use
      * @param parameters some parameters (not use currently but for future use)

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProvider.java?rev=1306403&r1=1306402&r2=1306403&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProvider.java
Wed Mar 28 15:13:37 2012
@@ -292,10 +292,9 @@ public class AccuRevScmProvider
     }
 
     @Override
-    protected AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
+    public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
         throws ScmException
     {
-
         AccuRevAddCommand command = new AccuRevAddCommand( getLogger() );
         return command.add( repository, fileSet, parameters );
     }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/IntegrityScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/IntegrityScmProvider.java?rev=1306403&r1=1306402&r2=1306403&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/IntegrityScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/IntegrityScmProvider.java
Wed Mar 28 15:13:37 2012
@@ -199,7 +199,7 @@ public class IntegrityScmProvider
      * Maps to si viewnonmembers and then si add for every non-member
      */
     @Override
-    protected AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
params )
+    public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
params )
         throws ScmException
     {
         IntegrityAddCommand command = new IntegrityAddCommand();

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/PerforceScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/PerforceScmProvider.java?rev=1306403&r1=1306402&r2=1306403&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/PerforceScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/PerforceScmProvider.java
Wed Mar 28 15:13:37 2012
@@ -161,7 +161,7 @@ public class PerforceScmProvider
         return (ChangeLogScmResult) command.execute( repository, fileSet, parameters );
     }
 
-    protected AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
params )
+    public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
params )
         throws ScmException
     {
         PerforceAddCommand command = new PerforceAddCommand();

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/TfsScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/TfsScmProvider.java?rev=1306403&r1=1306402&r2=1306403&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/TfsScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/TfsScmProvider.java
Wed Mar 28 15:13:37 2012
@@ -192,7 +192,7 @@ public class TfsScmProvider
         return (CheckInScmResult) command.execute( repository, fileSet, parameters );
     }
 
-    protected AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
+    public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
         throws ScmException
     {
         TfsAddCommand command = new TfsAddCommand();

Modified: maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/ScmTckTestCase.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/ScmTckTestCase.java?rev=1306403&r1=1306402&r2=1306403&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/ScmTckTestCase.java
(original)
+++ maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/ScmTckTestCase.java
Wed Mar 28 15:13:37 2012
@@ -159,6 +159,10 @@ public abstract class ScmTckTestCase
         throws Exception
     {
         ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() );
+
+        CommandParameters commandParameters = new CommandParameters();
+        commandParameters.setString( CommandParameter.FORCE_ADD, Boolean.TRUE.toString()
);
+
         AddScmResult result = provider.add( repository, new ScmFileSet( workingDirectory,
file ) );
 
         assertTrue( "Check result was successful, output: " + result.getCommandOutput(),
result.isSuccess() );

Modified: maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java?rev=1306403&r1=1306402&r2=1306403&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java
(original)
+++ maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java
Wed Mar 28 15:13:37 2012
@@ -387,6 +387,12 @@ public class ScmProviderStub
         return getAddScmResult();
     }
 
+    public AddScmResult add( ScmRepository repository, ScmFileSet fileSet, CommandParameters
commandParameters )
+        throws ScmException
+    {
+        return getAddScmResult();
+    }
+
     /**
      * {@inheritDoc}
      */



Mime
View raw message