You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2021/10/18 19:24:37 UTC

[maven-scm] branch SCM-969 updated: almost complete

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch SCM-969
in repository https://gitbox.apache.org/repos/asf/maven-scm.git


The following commit(s) were added to refs/heads/SCM-969 by this push:
     new 9e5e96e  almost complete
9e5e96e is described below

commit 9e5e96e2baedd7ec7b0ee654157b8629c3b5ea41
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Mon Oct 18 21:24:27 2021 +0200

    almost complete
---
 .../scm/command/checkout/CheckOutScmResult.java    |   2 +-
 .../org/apache/maven/scm/plugin/BootstrapMojo.java |   3 +-
 .../apache/maven/scm/plugin/RemoveMojoTest.java    | 112 ---------------------
 .../resources/mojos/remove/removeWithPerforce.xml  |  34 -------
 .../mojos/remove/removeWithPerforceNoIncludes.xml  |  33 ------
 .../command/checkout/LocalCheckOutCommand.java     |   6 --
 .../local/command/update/LocalUpdateCommand.java   |   6 --
 .../maven/scm/provider/svn/SvnTagBranchUtils.java  |   2 +-
 .../scm/provider/svn/SvnTagBranchUtilsTest.java    |  23 -----
 .../command/changelog/ChangeLogCommandTckTest.java |   5 +-
 10 files changed, 5 insertions(+), 221 deletions(-)

diff --git a/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/CheckOutScmResult.java b/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/CheckOutScmResult.java
index d4bdb4f..a9e5648 100644
--- a/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/CheckOutScmResult.java
+++ b/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/CheckOutScmResult.java
@@ -47,7 +47,7 @@ public class CheckOutScmResult
      * an empty String in case the checkout directory equals the project directory.
      * <p/>
      * With most SCMs, this is just an empty String, meaning that the checkout directory equals the project directory.
-     * But there are cases (e.g. ClearCase) where within the checkout directory, the directory structure of the
+     * But there are cases where within the checkout directory, the directory structure of the
      * SCM system is repeated. E.g. if you check out the project "my/project" to "/some/dir", the project sources
      * are actually checked out to "my/project/some/dir". In this example, relativePathProjectDirectory would
      * contain "my/project".
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java
index eed57e9..ecc4dd2 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java
@@ -102,8 +102,7 @@ public class BootstrapMojo
 
             ScmResult checkoutResult = this.getCheckoutResult();
 
-            //At the time of useExport feature is requested only SVN and and CVS have export command implemented
-            // we will deal with this as more user using this feature specially clearcase where we need to
+            //At the time of useExport feature is requested only SVN has export command implemented
             // add relativePathProjectDirectory support to ExportScmResult
             String relativePathProjectDirectory = "";
             if ( checkoutResult instanceof CheckOutScmResult )
diff --git a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/RemoveMojoTest.java b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/RemoveMojoTest.java
deleted file mode 100644
index f2728b3..0000000
--- a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/RemoveMojoTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.apache.maven.scm.plugin;
-
-/*
- * 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.
- */
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.apache.maven.scm.ScmTestCase;
-import org.codehaus.plexus.util.StringUtils;
-
-import java.io.File;
-
-/**
- * @author <a href="paul@webotech.co.uk">Paul Mackinlay</a>
- */
-public abstract class RemoveMojoTest //see https://jira.codehaus.org/browse/SCM-760
-    extends AbstractMojoTestCase
-{
-
-    public void testShouldInvokeP4Delete()
-        throws Exception
-    {
-
-        if ( !ScmTestCase.isSystemCmd( "p4" ) )
-        {
-            ScmTestCase.printSystemCmdUnavail( "p4", getName() );
-            return;
-        }
-
-        String testConfig = "src/test/resources/mojos/remove/removeWithPerforce.xml";
-        try
-        {
-            RemoveMojo removeMojo = (RemoveMojo) lookupMojo( "remove", getTestFile( testConfig ) );
-            String connectionUrl = removeMojo.getConnectionUrl();
-            connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() );
-            connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" );
-            removeMojo.setWorkingDirectory( new File( getBasedir() ) );
-            removeMojo.setConnectionUrl( connectionUrl );
-
-            removeMojo.execute();
-        }
-        finally
-        {
-            // Just to be sure unedit anything that has been marked for delete
-            UnEditMojo unEditMojo = (UnEditMojo) lookupMojo( "unedit", getTestFile( testConfig ) );
-            String connectionUrl = unEditMojo.getConnectionUrl();
-            connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() );
-            connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" );
-            unEditMojo.setWorkingDirectory( new File( getBasedir() ) );
-            unEditMojo.setConnectionUrl( connectionUrl );
-            unEditMojo.execute();
-        }
-    }
-
-    public void testShouldFailToInvokeP4Delete()
-        throws Exception
-    {
-        if ( !ScmTestCase.isSystemCmd( "p4" ) )
-        {
-            ScmTestCase.printSystemCmdUnavail( "p4", getName() );
-            return;
-        }
-        String testConfig = "src/test/resources/mojos/remove/removeWithPerforceNoIncludes.xml";
-        try
-        {
-            RemoveMojo removeMojo = (RemoveMojo) lookupMojo( "remove", getTestFile( testConfig ) );
-            String connectionUrl = removeMojo.getConnectionUrl();
-            connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() );
-            connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" );
-            removeMojo.setWorkingDirectory( new File( getBasedir() ) );
-            removeMojo.setConnectionUrl( connectionUrl );
-
-            try
-            {
-                removeMojo.execute();
-                fail( "At least one file needs to be included for removal" );
-            }
-            catch ( MojoExecutionException e )
-            {
-                // we're expecting this exception
-            }
-        }
-        finally
-        {
-            // Just to be sure unedit anything that has been marked for delete
-            UnEditMojo unEditMojo = (UnEditMojo) lookupMojo( "unedit", getTestFile( testConfig ) );
-            String connectionUrl = unEditMojo.getConnectionUrl();
-            connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() );
-            connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" );
-            unEditMojo.setWorkingDirectory( new File( getBasedir() ) );
-            unEditMojo.setConnectionUrl( connectionUrl );
-            unEditMojo.execute();
-        }
-    }
-
-}
diff --git a/maven-scm-plugin/src/test/resources/mojos/remove/removeWithPerforce.xml b/maven-scm-plugin/src/test/resources/mojos/remove/removeWithPerforce.xml
deleted file mode 100644
index 5322f72..0000000
--- a/maven-scm-plugin/src/test/resources/mojos/remove/removeWithPerforce.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
-  ~ 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.
-  -->
-
-<project>
-  <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-scm-plugin</artifactId>
-        <configuration>
-          <settings implementation="org.apache.maven.settings.Settings"/>
-          <connectionType>connection</connectionType>
-          <connectionUrl>scm:perforce:///${basedir}/target/repository/trunk</connectionUrl>
-		  <includes>pom.xml</includes>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
\ No newline at end of file
diff --git a/maven-scm-plugin/src/test/resources/mojos/remove/removeWithPerforceNoIncludes.xml b/maven-scm-plugin/src/test/resources/mojos/remove/removeWithPerforceNoIncludes.xml
deleted file mode 100644
index 2936154..0000000
--- a/maven-scm-plugin/src/test/resources/mojos/remove/removeWithPerforceNoIncludes.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
-  ~ 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.
-  -->
-
-<project>
-  <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-scm-plugin</artifactId>
-        <configuration>
-          <settings implementation="org.apache.maven.settings.Settings"/>
-          <connectionType>connection</connectionType>
-          <connectionUrl>scm:perforce:///${basedir}/target/repository/trunk</connectionUrl>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
\ No newline at end of file
diff --git a/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java b/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java
index 254b996..c6b83ee 100644
--- a/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java
@@ -151,12 +151,6 @@ public class LocalCheckOutCommand
 
             File parent = file.getParentFile();
 
-            // TODO: Add more excludes here
-            if ( parent != null && parent.getName().equals( "CVS" ) )
-            {
-                continue;
-            }
-
             String fileName = "/" + module + "/" + dest;
 
             checkedOutFiles.add( new ScmFile( fileName, ScmFileStatus.CHECKED_OUT ) );
diff --git a/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateCommand.java b/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateCommand.java
index 408e326..5458f41 100644
--- a/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateCommand.java
+++ b/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateCommand.java
@@ -152,12 +152,6 @@ public class LocalUpdateCommand
 
             File repositoryDirectory = repositoryFile.getParentFile();
 
-            // TODO: Add more excludes here
-            if ( repositoryDirectory != null && repositoryDirectory.getName().equals( "CVS" ) )
-            {
-                continue;
-            }
-
             String dest = repositoryFile.getAbsolutePath().substring( sourcePath.length() + 1 );
 
             File destinationFile = new File( baseDestination, dest );
diff --git a/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtils.java b/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtils.java
index 67798f2..1ebeff4 100644
--- a/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtils.java
+++ b/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtils.java
@@ -209,7 +209,7 @@ public final class SvnTagBranchUtils
             return null;
         }
 
-        // Look for a query string as in ViewCVS urls
+        // Look for a query string as in ViewSVN urls
         String queryString = null;
         if ( repositoryUrl.indexOf( '?' ) >= 0 )
         {
diff --git a/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtilsTest.java b/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtilsTest.java
index b9360e9..413c0b0 100644
--- a/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtilsTest.java
+++ b/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtilsTest.java
@@ -161,13 +161,6 @@ public class SvnTagBranchUtilsTest
 
     }
 
-    public void testResolveTagViewCVS()
-        throws Exception
-    {
-        assertEquals( "http://foo.com/cgi-bin/viewcvs.cgi/svn/tags/my-tag?root=test", SvnTagBranchUtils.resolveTagUrl(
-            "http://foo.com/cgi-bin/viewcvs.cgi/svn/trunk/?root=test", new ScmTag( "/my-tag/" ) ) );
-    }
-
     public void testResolveTagWithSlashes()
         throws Exception
     {
@@ -282,22 +275,6 @@ public class SvnTagBranchUtilsTest
 
     }
 
-    /**
-     * Test SCM-379
-     *
-     * @throws Exception if any
-     */
-    public void testResolveUrlWithQuery()
-        throws Exception
-    {
-        String url = "https://myserver/plugins/scmsvn/viewcvs.php/pom/trunk?root=myproj";
-
-        SvnScmProviderRepository repo = new SvnScmProviderRepository( url );
-
-        assertEquals( "https://myserver/plugins/scmsvn/viewcvs.php/pom/trunk/tags/mytag-1?root=myproj",
-                      SvnTagBranchUtils.resolveTagUrl( repo, new ScmTag( "mytag-1" ) ) );
-    }
-
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
diff --git a/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/changelog/ChangeLogCommandTckTest.java b/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/changelog/ChangeLogCommandTckTest.java
index 3d76817..1b9ac7a 100644
--- a/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/changelog/ChangeLogCommandTckTest.java
+++ b/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/changelog/ChangeLogCommandTckTest.java
@@ -58,12 +58,11 @@ public abstract class ChangeLogCommandTckTest
         assertTrue( firstResult.getProviderMessage() + ": " + firstResult.getCommandLine() + "\n"
                         + firstResult.getCommandOutput(), firstResult.isSuccess() );
 
-        //for svn, cvs, git, the repo get recreated for each test and therefore initial changelog size is 1
-        // for SCM like perforce, it is not possible to recreate the repo, therefor the size will be greater then 1
+        // for svn and git the repo get recreated for each test and therefore initial changelog size is 1
         int firstLogSize = firstResult.getChangeLog().getChangeSets().size();
         assertTrue( "Unexpected initial log size", firstLogSize >= 1 );
 
-        //Make a timestamp that we know are after initial revision but before the second
+        // Make a timestamp that we know are after initial revision but before the second
         Date timeBeforeSecond = new Date(); //Current time
 
         // pause a couple seconds... [SCM-244]