maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r892494 - in /maven/scm/trunk: ./ maven-scm-api/src/main/java/org/apache/maven/scm/ maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/ maven-scm-api/src/main/java/org/apache/maven/scm/provider/ maven-scm-providers/maven-scm-pr...
Date Sat, 19 Dec 2009 18:40:44 GMT
Author: olamy
Date: Sat Dec 19 18:40:43 2009
New Revision: 892494

URL: http://svn.apache.org/viewvc?rev=892494&view=rev
Log:
[SCM-515] branch command must support remote branching (svnexe)

Added:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmBranchParameters.java
  (with props)
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/CommandParameters.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/AbstractBranchCommand.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-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/branch/SvnBranchCommand.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/branch/SvnExeBranchCommandTckTest.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java
    maven/scm/trunk/pom.xml

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=892494&r1=892493&r2=892494&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
Sat Dec 19 18:40:43 2009
@@ -68,6 +68,8 @@
         new CommandParameter( "run_changelog_with_update" );
 
     public static final CommandParameter SCM_TAG_PARAMETERS = new CommandParameter( "ScmTagParameters"
);
+    
+    public static final CommandParameter SCM_BRANCH_PARAMETERS = new CommandParameter( "ScmBranchParameters"
);
 
 
     /**

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameters.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameters.java?rev=892494&r1=892493&r2=892494&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameters.java
(original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameters.java
Sat Dec 19 18:40:43 2009
@@ -291,6 +291,20 @@
         setObject( parameter, scmTagParameters );
     }
 
+    public void setScmBranchParameters( CommandParameter parameter, ScmBranchParameters scmBranchParameters
)
+        throws ScmException
+    {
+        setObject( parameter, scmBranchParameters );
+    }
+
+    public ScmBranchParameters getScmBranchParameters( CommandParameter parameter )
+        throws ScmException
+    {
+        return (ScmBranchParameters) getObject( ScmBranchParameters.class, parameter, new
ScmBranchParameters() );
+    }
+
+    
+    
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmBranchParameters.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmBranchParameters.java?rev=892494&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmBranchParameters.java
(added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmBranchParameters.java
Sat Dec 19 18:40:43 2009
@@ -0,0 +1,83 @@
+package org.apache.maven.scm;
+
+import java.io.Serializable;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author <a href="mailto:olamy@apache.org">olamy</a>
+ * @since 1.2
+ */
+public class ScmBranchParameters
+    implements Serializable
+{
+    private static final long serialVersionUID = 7241536408630608707L;
+
+    private String message;
+
+    private boolean remoteBranching = false;
+
+    private String scmRevision;
+
+    public ScmBranchParameters()
+    {
+        this.remoteBranching = false;
+    }
+
+    public ScmBranchParameters( String message )
+    {
+        this.message = message;
+    }
+
+    public String getMessage()
+    {
+        return message;
+    }
+
+    public void setMessage( String message )
+    {
+        this.message = message;
+    }
+
+    public String getScmRevision()
+    {
+        return scmRevision;
+    }
+
+    public void setScmRevision( String scmRevision )
+    {
+        this.scmRevision = scmRevision;
+    }
+
+    public boolean isRemoteBranching()
+    {
+        return remoteBranching;
+    }
+
+    public void setRemoteBranching( boolean remoteBranching )
+    {
+        this.remoteBranching = remoteBranching;
+    }
+
+    public String toString()
+    {
+        return "[" + scmRevision + "] " + message;
+    }
+}

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmBranchParameters.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmBranchParameters.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/AbstractBranchCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/AbstractBranchCommand.java?rev=892494&r1=892493&r2=892494&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/AbstractBranchCommand.java
(original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/AbstractBranchCommand.java
Sat Dec 19 18:40:43 2009
@@ -21,11 +21,13 @@
 
 import org.apache.maven.scm.CommandParameter;
 import org.apache.maven.scm.CommandParameters;
+import org.apache.maven.scm.ScmBranchParameters;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmResult;
 import org.apache.maven.scm.command.AbstractCommand;
 import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.codehaus.plexus.util.StringUtils;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -38,6 +40,23 @@
     protected abstract ScmResult executeBranchCommand( ScmProviderRepository repository,
ScmFileSet fileSet,
                                                        String branchName, String message
)
         throws ScmException;
+    
+    /**
+     * default impl to provide backward comp
+     * @since 1.3
+     * @param repository
+     * @param fileSet
+     * @param branchName
+     * @param scmBranchParameters
+     * @return
+     * @throws ScmException
+     */
+    protected ScmResult executeBranchCommand( ScmProviderRepository repository, ScmFileSet
fileSet, String branchName,
+                                              ScmBranchParameters scmBranchParameters )
+        throws ScmException
+    {
+        return executeBranchCommand( repository, fileSet, branchName, scmBranchParameters.getMessage()
);
+    }
 
     /** {@inheritDoc} */
     public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
@@ -46,8 +65,15 @@
     {
         String branchName = parameters.getString( CommandParameter.BRANCH_NAME );
 
+        ScmBranchParameters scmBranchParameters = parameters.getScmBranchParameters( CommandParameter.SCM_BRANCH_PARAMETERS
);
+        
         String message = parameters.getString( CommandParameter.MESSAGE, "[maven-scm] copy
for branch " + branchName );
-
-        return executeBranchCommand( repository, fileSet, branchName, message );
+        
+        if (StringUtils.isBlank( scmBranchParameters.getMessage()) && StringUtils.isNotBlank(
message ) ) 
+        {
+            scmBranchParameters.setMessage( message );
+        }
+        
+        return executeBranchCommand( repository, fileSet, branchName, scmBranchParameters
);
     }
 }

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=892494&r1=892493&r2=892494&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
Sat Dec 19 18:40:43 2009
@@ -23,6 +23,7 @@
 import org.apache.maven.scm.CommandParameters;
 import org.apache.maven.scm.NoSuchCommandScmException;
 import org.apache.maven.scm.ScmBranch;
+import org.apache.maven.scm.ScmBranchParameters;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmRevision;
@@ -150,26 +151,37 @@
     public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName
)
         throws ScmException
     {
-        return branch( repository, fileSet, branchName, null );
+        return branch( repository, fileSet, branchName, new ScmBranchParameters() );
     }
 
     /** {@inheritDoc} */
     public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName,
String message )
         throws ScmException
     {
+        ScmBranchParameters scmBranchParameters = new ScmBranchParameters();
+        
+        if ( StringUtils.isNotEmpty( message ) )
+        {
+            scmBranchParameters.setMessage( message );
+        }
+
+        return branch( repository, fileSet, branchName, scmBranchParameters );
+    }
+    
+    public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName,
+                                   ScmBranchParameters scmBranchParameters )
+        throws ScmException
+    {
         login( repository, fileSet );
 
         CommandParameters parameters = new CommandParameters();
-
+        
         parameters.setString( CommandParameter.BRANCH_NAME, branchName );
 
-        if ( StringUtils.isNotEmpty( message ) )
-        {
-            parameters.setString( CommandParameter.MESSAGE, message );
-        }
+        parameters.setScmBranchParameters( CommandParameter.SCM_BRANCH_PARAMETERS, scmBranchParameters
);
 
         return branch( repository.getProviderRepository(), fileSet, parameters );
-    }
+    }  
 
     protected BranchScmResult branch( ScmProviderRepository repository, ScmFileSet fileSet,
                                       CommandParameters parameters )

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=892494&r1=892493&r2=892494&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
Sat Dec 19 18:40:43 2009
@@ -20,6 +20,7 @@
  */
 
 import org.apache.maven.scm.ScmBranch;
+import org.apache.maven.scm.ScmBranchParameters;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmTagParameters;
@@ -134,6 +135,7 @@
      * @param fileSet    the files to branch. Implementations can also give the changes
      *                   from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
      * @param branchName the branch name to apply to the files
+     * @deprecated use {@link #branch(ScmRepository, ScmFileSet, String, String, ScmBranchParameters)}
      * @return
      * @throws ScmException if any
      */
@@ -148,11 +150,28 @@
      *                   from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
      * @param branchName the branch name to apply to the files
      * @param message    the commit message used for the tag creation
+     * @deprecated use {@link #branch(ScmRepository, ScmFileSet, String, String, ScmBranchParameters)}
      * @return
      * @throws ScmException if any
      */
     BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName,
String message )
         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
+     * @param fileSet the files to branch. Implementations can also give the changes from
the
+     *            {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
+     * @param branchName the branch name to apply to the files
+     * @param message the commit message used for the tag creation
+     * @since 1.3
+     * @return
+     * @throws ScmException if any
+     */
+    BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName,
ScmBranchParameters scmBranchParameters )
+        throws ScmException;    
 
     /**
      * Returns the changes that have happend in the source control system in a certain period
of time.
@@ -560,6 +579,7 @@
      * @param fileSet    the files to tag. Implementations can also give the changes
      *                   from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
      * @param tagName    the tag name to apply to the files
+     * @deprecated use {@link #tag(ScmRepository, ScmFileSet, String, ScmTagParameters)}
      * @return
      * @throws ScmException if any
      */

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/branch/SvnBranchCommand.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/branch/SvnBranchCommand.java?rev=892494&r1=892493&r2=892494&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/branch/SvnBranchCommand.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/branch/SvnBranchCommand.java
Sat Dec 19 18:40:43 2009
@@ -20,6 +20,7 @@
  */
 
 import org.apache.maven.scm.ScmBranch;
+import org.apache.maven.scm.ScmBranchParameters;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmFileSet;
@@ -54,10 +55,9 @@
     extends AbstractBranchCommand
     implements SvnCommand
 {
-    /** {@inheritDoc} */
-    public ScmResult executeBranchCommand( ScmProviderRepository repo, ScmFileSet fileSet,
String branch,
-                                           String message )
-        throws ScmException
+    
+    public ScmResult executeBranchCommand( ScmProviderRepository repo, ScmFileSet fileSet,
String branch, ScmBranchParameters scmBranchParameters )
+    throws ScmException
     {
         if ( branch == null || StringUtils.isEmpty( branch.trim() ) )
         {
@@ -75,7 +75,7 @@
 
         try
         {
-            FileUtils.fileWrite( messageFile.getAbsolutePath(), message );
+            FileUtils.fileWrite( messageFile.getAbsolutePath(), scmBranchParameters.getMessage()
);
         }
         catch ( IOException ex )
         {
@@ -83,7 +83,7 @@
                 + ex.getMessage(), null, false );
         }
 
-        Commandline cl = createCommandLine( repository, fileSet.getBasedir(), branch, messageFile
);
+        Commandline cl = createCommandLine( repository, fileSet.getBasedir(), branch, messageFile,
scmBranchParameters );
 
         CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
 
@@ -144,6 +144,15 @@
 
         return new BranchScmResult( cl.toString(), fileList );
     }
+    
+    /** {@inheritDoc} */
+    public ScmResult executeBranchCommand( ScmProviderRepository repo, ScmFileSet fileSet,
String branch,
+                                           String message )
+        throws ScmException
+    {
+        ScmBranchParameters scmBranchParameters = new ScmBranchParameters( message );
+        return executeBranchCommand( repo, fileSet, branch, scmBranchParameters );
+    }
 
     // ----------------------------------------------------------------------
     //
@@ -152,6 +161,14 @@
     public static Commandline createCommandLine( SvnScmProviderRepository repository, File
workingDirectory,
                                                  String branch, File messageFile )
     {
+        ScmBranchParameters scmBranchParameters = new ScmBranchParameters();
+        scmBranchParameters.setRemoteBranching( false );
+        return createCommandLine( repository, workingDirectory, branch, messageFile, scmBranchParameters
);
+    }
+    
+    public static Commandline createCommandLine( SvnScmProviderRepository repository, File
workingDirectory,
+                                                 String branch, File messageFile, ScmBranchParameters
scmBranchParameters )
+    {
         Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( workingDirectory, repository
);
 
         cl.createArg().setValue( "copy" );
@@ -160,12 +177,23 @@
 
         cl.createArg().setValue( messageFile.getAbsolutePath() );
 
-        cl.createArg().setValue( "." );
-
+        if ( scmBranchParameters != null && scmBranchParameters.isRemoteBranching()
)
+        {
+            if (StringUtils.isNotBlank( scmBranchParameters.getScmRevision() ) )
+            {
+                cl.createArg().setValue( "--revision" );
+                cl.createArg().setValue( scmBranchParameters.getScmRevision() );
+            }
+            cl.createArg().setValue( repository.getUrl() );
+        }
+        else
+        {
+            cl.createArg().setValue( "." );
+        }
         // Note: this currently assumes you have the branch base checked out too
         String branchUrl = SvnTagBranchUtils.resolveBranchUrl( repository, new ScmBranch(
branch ) );
         cl.createArg().setValue( SvnCommandUtils.fixUrl( branchUrl, repository.getUser()
) );
 
         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/branch/SvnExeBranchCommandTckTest.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/branch/SvnExeBranchCommandTckTest.java?rev=892494&r1=892493&r2=892494&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/branch/SvnExeBranchCommandTckTest.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/branch/SvnExeBranchCommandTckTest.java
Sat Dec 19 18:40:43 2009
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.maven.scm.ScmBranchParameters;
 import org.apache.maven.scm.provider.svn.command.branch.SvnBranchCommandTckTest;
 import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
 import org.apache.maven.scm.repository.ScmRepository;
@@ -35,6 +36,48 @@
 public class SvnExeBranchCommandTckTest
     extends SvnBranchCommandTckTest
 {
+    
+    public void testBranchUserNameSvnHttpsRemoteBranchingWithRev()
+        throws Exception
+    {
+        File messageFile = File.createTempFile( "maven-scm", "commit" );
+        messageFile.deleteOnExit();
+
+        ScmBranchParameters scmBranchParameters = new ScmBranchParameters();
+        scmBranchParameters.setRemoteBranching( true );
+        scmBranchParameters.setScmRevision( "2" );
+
+        testCommandLine( "scm:svn:https://foo.com/svn/trunk", "svnbranch", messageFile, "user",
+                         "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath()
+                             + " --revision 2 https://foo.com/svn/trunk https://foo.com/svn/branches/svnbranch",
+                         scmBranchParameters );
+    }
+
+    public void testBranchUserNameSvnHttpsRemoteBranchingNoRev()
+        throws Exception
+    {
+        File messageFile = File.createTempFile( "maven-scm", "commit" );
+        messageFile.deleteOnExit();
+
+        ScmBranchParameters scmBranchParameters = new ScmBranchParameters();
+        scmBranchParameters.setRemoteBranching( true );
+
+        testCommandLine( "scm:svn:https://foo.com/svn/trunk", "svnbranch", messageFile, "user",
+                         "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath()
+                             + " https://foo.com/svn/trunk https://foo.com/svn/branches/svnbranch",
scmBranchParameters );
+    }
+
+    public void testBranchUserNameSvnHttps()
+        throws Exception
+    {
+        File messageFile = File.createTempFile( "maven-scm", "commit" );
+        messageFile.deleteOnExit();
+
+        testCommandLine( "scm:svn:https://foo.com/svn/trunk", "svnbranch", messageFile, "user",
+                         "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath()
+                             + " . https://foo.com/svn/branches/svnbranch", null );
+    }
+
     public void testBranchUserNameSvnSsh()
         throws Exception
     {
@@ -42,11 +85,12 @@
         messageFile.deleteOnExit();
 
         testCommandLine( "scm:svn:svn+ssh://foo.com/svn/trunk", "svnbranch", messageFile,
"user",
-                         "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath()
+
-                             " . svn+ssh://user@foo.com/svn/branches/svnbranch" );
+                         "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath()
+                             + " . svn+ssh://user@foo.com/svn/branches/svnbranch" );
     }
 
-    private void testCommandLine( String scmUrl, String branch, File messageFile, String
user, String commandLine )
+    private void testCommandLine( String scmUrl, String branch, File messageFile, String
user, String commandLine,
+                                  ScmBranchParameters scmBranchParameters )
         throws Exception
     {
         File workingDirectory = getTestFile( "target/svn-update-command-test" );
@@ -57,8 +101,23 @@
 
         svnRepository.setUser( user );
 
-        Commandline cl = SvnBranchCommand.createCommandLine( svnRepository, workingDirectory,
branch, messageFile );
+        Commandline cl = null;
+        if ( scmBranchParameters == null )
+        {
+            cl = SvnBranchCommand.createCommandLine( svnRepository, workingDirectory, branch,
messageFile );
+        }
+        else
+        {
+            cl = SvnBranchCommand.createCommandLine( svnRepository, workingDirectory, branch,
messageFile,
+                                                     scmBranchParameters );
+        }
 
         assertCommandLine( commandLine, workingDirectory, cl );
     }
+
+    private void testCommandLine( String scmUrl, String branch, File messageFile, String
user, String commandLine )
+        throws Exception
+    {
+        testCommandLine( scmUrl, branch, messageFile, user, commandLine, null );
+    }
 }

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=892494&r1=892493&r2=892494&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
Sat Dec 19 18:40:43 2009
@@ -20,6 +20,7 @@
  */
 
 import org.apache.maven.scm.ScmBranch;
+import org.apache.maven.scm.ScmBranchParameters;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmTagParameters;
@@ -349,6 +350,13 @@
     }
 
     /** {@inheritDoc} */
+    public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName,
ScmBranchParameters scmBranchParameters )
+        throws ScmException
+    {
+        return getBranchScmResult();
+    }    
+    
+    /** {@inheritDoc} */
     public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date
startDate, Date endDate,
                                          int numDays, String branch )
         throws ScmException

Modified: maven/scm/trunk/pom.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/pom.xml?rev=892494&r1=892493&r2=892494&view=diff
==============================================================================
--- maven/scm/trunk/pom.xml (original)
+++ maven/scm/trunk/pom.xml Sat Dec 19 18:40:43 2009
@@ -328,6 +328,6 @@
           </plugin>
         </plugins>
       </reporting>
-    </profile>
+    </profile>   
   </profiles>
 </project>



Mime
View raw message