maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r690992 - in /maven/scm/trunk: maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/ maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/ maven-scm-providers/mave...
Date Mon, 01 Sep 2008 15:08:25 GMT
Author: vsiveton
Date: Mon Sep  1 08:08:23 2008
New Revision: 690992

URL: http://svn.apache.org/viewvc?rev=690992&view=rev
Log:
SCM-346: Recursive flag is not implemented in the check out command
Submitted by: David Cuesta
Reviewed by: Vincent Siveton

o patch partially applied
o take care of backward compatibility
o update other providers
o added test case

Modified:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutUsingPopCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutWorkspaceCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkout/BazaarCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkout/SynergyCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/AbstractCvsCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommandTest.java

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java
(original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java
Mon Sep  1 08:08:23 2008
@@ -36,8 +36,36 @@
 public abstract class AbstractCheckOutCommand
     extends AbstractCommand
 {
-    protected abstract CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository,
ScmFileSet fileSet,
+    /**
+     * Execute Check out command line in a recursive check out way.
+     *
+     * @param repository not null
+     * @param fileSet not null
+     * @param scmVersion not null
+     * @return the checkout result
+     * @throws ScmException if any
+     * @see #executeCheckOutCommand(ScmProviderRepository, ScmFileSet, ScmVersion, boolean)
+     */
+    protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository,
ScmFileSet fileSet,
                                                                  ScmVersion scmVersion )
+        throws ScmException
+    {
+        return executeCheckOutCommand( repository, fileSet, scmVersion, true );
+    }
+
+    /**
+     * Execute Check out command line.
+     *
+     * @param repository not null
+     * @param fileSet not null
+     * @param scmVersion not null
+     * @param recursive <code>true</code> if recursive check out is wanted, <code>false</code>
otherwise.
+     * @return the checkout result
+     * @throws ScmException if any
+     * @since 1.1.1
+     */
+    protected abstract CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository,
ScmFileSet fileSet,
+                                                                 ScmVersion scmVersion, boolean
recursive )
         throws ScmException;
 
     /** {@inheritDoc} */
@@ -46,6 +74,12 @@
         throws ScmException
     {
         ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null
);
+        String recursiveParam = parameters.getString( CommandParameter.RECURSIVE, null );
+        if ( recursiveParam != null )
+        {
+            boolean recursive = parameters.getBoolean( CommandParameter.RECURSIVE );
+            return executeCheckOutCommand( repository, fileSet, scmVersion, recursive );
+        }
 
         return executeCheckOutCommand( repository, fileSet, scmVersion );
     }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutUsingPopCommand.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/commands/checkout/AccuRevCheckOutUsingPopCommand.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutUsingPopCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutUsingPopCommand.java
Mon Sep  1 08:08:23 2008
@@ -61,7 +61,7 @@
 
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository,
ScmFileSet fileSet,
-                                                        ScmVersion version )
+                                                        ScmVersion version, boolean recursive
)
         throws ScmException
     {
         try

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutWorkspaceCommand.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/commands/checkout/AccuRevCheckOutWorkspaceCommand.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutWorkspaceCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutWorkspaceCommand.java
Mon Sep  1 08:08:23 2008
@@ -59,7 +59,7 @@
 
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository,
ScmFileSet fileSet,
-                                                        ScmVersion version )
+                                                        ScmVersion version, boolean recursive
)
         throws ScmException
     {
         try

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkout/BazaarCheckOutCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkout/BazaarCheckOutCommand.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkout/BazaarCheckOutCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkout/BazaarCheckOutCommand.java
Mon Sep  1 08:08:23 2008
@@ -47,7 +47,7 @@
 {
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet
fileSet,
-                                                        ScmVersion version )
+                                                        ScmVersion version, boolean recursive
)
         throws ScmException
     {
 

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java
Mon Sep  1 08:08:23 2008
@@ -57,7 +57,7 @@
 
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository,
ScmFileSet fileSet,
-                                                        ScmVersion version )
+                                                        ScmVersion version, boolean recursive
)
         throws ScmException
     {
         getLogger().debug( "executing checkout command..." );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java
Mon Sep  1 08:08:23 2008
@@ -47,7 +47,7 @@
 {
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet
fileSet,
-                                                        ScmVersion scmVersion )
+                                                        ScmVersion scmVersion, boolean recursive
)
         throws ScmException
     {
         HgScmProviderRepository repository = (HgScmProviderRepository) repo;

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java
Mon Sep  1 08:08:23 2008
@@ -49,7 +49,7 @@
 {
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet
fileSet,
-                                                        ScmVersion version )
+                                                        ScmVersion version, boolean recursive
)
         throws ScmException
     {
         LocalScmProviderRepository repository = (LocalScmProviderRepository) repo;

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutCommand.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/command/checkout/PerforceCheckOutCommand.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutCommand.java
Mon Sep  1 08:08:23 2008
@@ -63,7 +63,7 @@
      * {@inheritDoc}
      */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet
files,
-                                                        ScmVersion version )
+                                                        ScmVersion version, boolean recursive
)
         throws ScmException
     {
         PerforceScmProviderRepository prepo = (PerforceScmProviderRepository) repo;

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java
Mon Sep  1 08:08:23 2008
@@ -50,7 +50,7 @@
 
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet
fileSet,
-                                                        ScmVersion version )
+                                                        ScmVersion version, boolean recursive
)
         throws ScmException
     {
         if ( fileSet.getFileList().size() != 0 )

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkout/SynergyCheckOutCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkout/SynergyCheckOutCommand.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkout/SynergyCheckOutCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkout/SynergyCheckOutCommand.java
Mon Sep  1 08:08:23 2008
@@ -46,7 +46,7 @@
 
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository,
ScmFileSet fileSet,
-                                                        ScmVersion version )
+                                                        ScmVersion version, boolean recursive
)
         throws ScmException
     {
         if ( fileSet.getFileList().size() != 0 )

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.java
Mon Sep  1 08:08:23 2008
@@ -41,7 +41,7 @@
 
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository,
ScmFileSet fileSet,
-                                                        ScmVersion version )
+                                                        ScmVersion version, boolean recursive
)
         throws ScmException
     {
         getLogger().debug( "executing checkout command..." );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/AbstractCvsCheckOutCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/AbstractCvsCheckOutCommand.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/AbstractCvsCheckOutCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/AbstractCvsCheckOutCommand.java
Mon Sep  1 08:08:23 2008
@@ -45,7 +45,7 @@
 {
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet
fileSet,
-                                                        ScmVersion version )
+                                                        ScmVersion version, boolean recursive
)
         throws ScmException
     {
         if ( fileSet.getBasedir().exists() )

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java
Mon Sep  1 08:08:23 2008
@@ -55,7 +55,7 @@
      * {@inheritDoc}
      */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet
fileSet,
-                                                        ScmVersion version )
+                                                        ScmVersion version, boolean recursive
)
         throws ScmException
     {
         GitScmProviderRepository repository = (GitScmProviderRepository) repo;

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommand.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommand.java
Mon Sep  1 08:08:23 2008
@@ -50,7 +50,7 @@
 {
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet
fileSet,
-                                                        ScmVersion version )
+                                                        ScmVersion version, boolean recursive
)
         throws ScmException
     {
         SvnScmProviderRepository repository = (SvnScmProviderRepository) repo;
@@ -71,7 +71,7 @@
 
         url = SvnCommandUtils.fixUrl( url, repository.getUser() );
 
-        Commandline cl = createCommandLine( repository, fileSet.getBasedir(), version, url
);
+        Commandline cl = createCommandLine( repository, fileSet.getBasedir(), version, url,
recursive );
 
         SvnCheckOutConsumer consumer = new SvnCheckOutConsumer( getLogger(), fileSet.getBasedir().getParentFile()
);
 
@@ -103,26 +103,59 @@
     //
     // ----------------------------------------------------------------------
 
+    /**
+     * Create SVN check out command line in a recursive way.
+     *
+     * @param repository not null
+     * @param workingDirectory not null
+     * @param version not null
+     * @param url not null
+     * @return the SVN command line for the SVN check out.
+     * @see #createCommandLine(SvnScmProviderRepository, File, ScmVersion, String, boolean)
+     */
     public static Commandline createCommandLine( SvnScmProviderRepository repository, File
workingDirectory,
                                                  ScmVersion version, String url )
     {
+        return createCommandLine( repository, workingDirectory, version, url, true );
+    }
+
+    /**
+     * Create SVN check out command line.
+     *
+     * @param repository not null
+     * @param workingDirectory not null
+     * @param version not null
+     * @param url not null
+     * @param recursive <code>true</code> if recursive check out is wanted, <code>false</code>
otherwise.
+     * @return the SVN command line for the SVN check out.
+     * @since 1.1.1
+     */
+    public static Commandline createCommandLine( SvnScmProviderRepository repository, File
workingDirectory,
+                                                 ScmVersion version, String url, boolean
recursive )
+    {
         Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( workingDirectory.getParentFile(),
repository );
 
-        cl.createArgument().setValue( "checkout" );
+        cl.createArg().setValue( "checkout" );
+
+        // add non recursive option
+        if ( !recursive )
+        {
+            cl.createArg().setValue( "-N" );
+        }
 
         if ( version != null && StringUtils.isNotEmpty( version.getName() ) )
         {
             if ( version instanceof ScmRevision )
             {
-                cl.createArgument().setValue( "-r" );
+                cl.createArg().setValue( "-r" );
 
-                cl.createArgument().setValue( version.getName() );
+                cl.createArg().setValue( version.getName() );
             }
         }
 
-        cl.createArgument().setValue( url );
+        cl.createArg().setValue( url );
 
-        cl.createArgument().setValue( workingDirectory.getName() );
+        cl.createArg().setValue( workingDirectory.getName() );
 
         return cl;
     }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommandTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommandTest.java?rev=690992&r1=690991&r2=690992&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommandTest.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommandTest.java
Mon Sep  1 08:08:23 2008
@@ -24,6 +24,7 @@
 import org.apache.maven.scm.manager.ScmManager;
 import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
 import org.apache.maven.scm.repository.ScmRepository;
+import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 
 import java.io.File;
@@ -37,6 +38,8 @@
 {
     private File workingDirectory;
 
+    private boolean recursive;
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -46,7 +49,12 @@
     {
         super.setUp();
 
+        recursive = true;
         workingDirectory = getTestFile( "target/svn-checkout-command-test" );
+        if ( workingDirectory != null && workingDirectory.isDirectory() )
+        {
+            FileUtils.deleteDirectory( workingDirectory );
+        }
     }
 
     // ----------------------------------------------------------------------
@@ -71,8 +79,17 @@
         throws Exception
     {
         testCommandLine( getScmManager(), "scm:svn:http://foo.com/svn/trunk", "10",
-                         "svn --non-interactive checkout -r 10 http://foo.com/svn/trunk "
+
-                             workingDirectory.getName() );
+                         "svn --non-interactive checkout -r 10 http://foo.com/svn/trunk "
+                             + workingDirectory.getName() );
+    }
+
+    public void testRecursiveCheckOutCommandLine()
+        throws Exception
+    {
+        recursive = false;
+        testCommandLine( getScmManager(), "scm:svn:http://foo.com/svn/trunk", "10",
+                         "svn --non-interactive checkout -N -r 10 http://foo.com/svn/trunk
"
+                             + workingDirectory.getName() );
     }
 
     // ----------------------------------------------------------------------
@@ -86,8 +103,11 @@
 
         SvnScmProviderRepository svnRepository = (SvnScmProviderRepository) repository.getProviderRepository();
 
-        Commandline cl = SvnCheckOutCommand.createCommandLine( svnRepository, workingDirectory,
-                                                               new ScmRevision( revision
), svnRepository.getUrl() );
+        Commandline cl =
+            cl =
+                SvnCheckOutCommand.createCommandLine( svnRepository, workingDirectory,
+                                                      new ScmRevision( revision ), svnRepository.getUrl(),
+                                                      recursive );
 
         assertCommandLine( commandLine, workingDirectory.getParentFile(), cl );
     }



Mime
View raw message