maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r382496 - in /maven/sandbox/wagon-scm/src: main/java/org/apache/maven/wagon/providers/scm/ test/java/org/apache/maven/wagon/providers/scm/ test/resources/test-repo-cvs/ test/resources/test-repo/
Date Thu, 02 Mar 2006 20:06:06 GMT
Author: carlos
Date: Thu Mar  2 12:06:04 2006
New Revision: 382496

URL: http://svn.apache.org/viewcvs?rev=382496&view=rev
Log:
Name tests as cvs dependant

Added:
    maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsWagonTest.java
      - copied, changed from r382487, maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmWagonTest.java
    maven/sandbox/wagon-scm/src/test/resources/test-repo-cvs/
      - copied from r382201, maven/sandbox/wagon-scm/src/test/resources/test-repo/
Removed:
    maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmWagonTest.java
    maven/sandbox/wagon-scm/src/test/resources/test-repo/
Modified:
    maven/sandbox/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java

Modified: maven/sandbox/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java
URL: http://svn.apache.org/viewcvs/maven/sandbox/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java?rev=382496&r1=382495&r2=382496&view=diff
==============================================================================
--- maven/sandbox/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java
(original)
+++ maven/sandbox/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java
Thu Mar  2 12:06:04 2006
@@ -168,14 +168,18 @@
             }
             checkScmResult( result );
 
+            boolean fileAlreadyInScm = scmFile.exists();
+
             if ( !scmFile.equals( source ) )
             {
                 FileUtils.copyFile( source, scmFile );
             }
 
-            // TODO: detect if it is necessary to add first!
-            result = scmProvider.add( scmRepository, new ScmFileSet( basedir, scmFile ) );
-            checkScmResult( result );
+            if ( !fileAlreadyInScm )
+            {
+                result = scmProvider.add( scmRepository, new ScmFileSet( basedir, scmFile
) );
+                checkScmResult( result );
+            }
             result = scmProvider.checkIn( scmRepository, new ScmFileSet( basedir, scmFile
), null, msg );
             checkScmResult( result );
 

Copied: maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsWagonTest.java
(from r382487, maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmWagonTest.java)
URL: http://svn.apache.org/viewcvs/maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsWagonTest.java?p2=maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsWagonTest.java&p1=maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmWagonTest.java&r1=382487&r2=382496&rev=382496&view=diff
==============================================================================
--- maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmWagonTest.java
(original)
+++ maven/sandbox/wagon-scm/src/test/java/org/apache/maven/wagon/providers/scm/ScmCvsWagonTest.java
Thu Mar  2 12:06:04 2006
@@ -29,7 +29,7 @@
  * @author <a href="brett@apache.org">Brett Porter</a>
  * @version $Id$
  */
-public class ScmWagonTest
+public class ScmCvsWagonTest
     extends WagonTestCase
 {
     protected void setUp()
@@ -52,7 +52,7 @@
 
     private File getCheckoutDirectory()
     {
-        return new File( FileTestUtils.getTestOutputDir(), "/checkout");
+        return new File( FileTestUtils.getTestOutputDir(), "/checkout-cvs");
     }
 
     protected String getProtocol()
@@ -63,7 +63,7 @@
     protected String getTestRepositoryUrl()
         throws IOException
     {
-        String repository = getTestFile( "target/test-classes/test-repo" ).getAbsolutePath();
+        String repository = getTestFile( "target/test-classes/test-repo-cvs" ).getAbsolutePath();
 
         // TODO: this is a hack for windows
         if ( repository.indexOf( ":" ) >= 0 )



Mime
View raw message