maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r382813 - /maven/sandbox/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java
Date Fri, 03 Mar 2006 13:50:27 GMT
Author: evenisse
Date: Fri Mar  3 05:50:26 2006
New Revision: 382813

URL: http://svn.apache.org/viewcvs?rev=382813&view=rev
Log:
Remove all tests on specific CVS/.svn directories

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=382813&r1=382812&r2=382813&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
Fri Mar  3 05:50:26 2006
@@ -40,6 +40,7 @@
 
 /**
  * @author <a href="brett@apache.org">Brett Porter</a>
+ * @author <a href="evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
  */
 public class ScmWagon
@@ -93,6 +94,7 @@
         }
 
         ScmRepository scmRepository;
+
         try
         {
             scmRepository = scmManager.makeScmRepository( url );
@@ -153,21 +155,25 @@
             String msg = "Adding " + resourceName + " to repository";
 
             ScmProvider scmProvider = scmManager.getProviderByRepository( scmRepository );
+
             ScmResult result;
 
-            //TODO check in other way non svn, cvs specific
-            if ( new File( basedir, ".svn" ).exists() || new File( basedir, "CVS" ).exists()
)
+            String reservedScmFile = scmProvider.getScmSpecificFilename();
+
+            if ( reservedScmFile != null && new File( basedir, reservedScmFile ).exists()
)
             {
                 result = scmProvider.update( scmRepository, new ScmFileSet( basedir ), null
);
             }
             else
             {
                 File lastOne = mkdirs( basedir, scmRepository );
+
                 result = scmProvider.checkOut( scmRepository, new ScmFileSet( basedir ),
null );
 
                 if ( lastOne != null )
                 {
                     checkScmResult( result );
+
                     result = scmProvider.checkIn( scmRepository, new ScmFileSet( lastOne.getParentFile(),
lastOne ),
                                                   null, msg );
                 }
@@ -194,6 +200,7 @@
             }
 
             result = scmProvider.checkIn( scmRepository, new ScmFileSet( basedir, scmFile
), null, msg );
+
             checkScmResult( result );
 
         }
@@ -221,13 +228,15 @@
 
         checkScmResult( result );
 
+        String reservedScmFile = scmProvider.getScmSpecificFilename();
+
         if ( scmFile.isDirectory() )
         {
             File[] files = scmFile.listFiles();
 
             for ( int i = 0; i < files.length; i++ )
             {
-                if ( !"CVS".equals( files[i].getName() ) && !".svn".equals( files[i].getName()
) )
+                if ( reservedScmFile != null && !reservedScmFile.equals( files[i].getName()
) )
                 {
                     addFiles( scmProvider, scmRepository, basedir, files[i] );
                 }
@@ -247,6 +256,7 @@
         {
             throw new IllegalArgumentException( "Source is not a directory: " + sourceDirectory
);
         }
+
         putInternal( sourceDirectory, destinationDirectory );
     }
 
@@ -269,19 +279,21 @@
         {
             File parent = basedir.getParentFile();
 
-            // TODO: ewwww
-            if ( !new File( parent, ".svn" ).exists() && !new File( parent, "CVS"
).exists() )
+            ScmProvider scmProvider = scmManager.getProviderByRepository( scmRepository );
+
+            String reservedScmFile = scmProvider.getScmSpecificFilename();
+
+            if ( reservedScmFile != null && !new File( parent, reservedScmFile ).exists()
)
             {
                 lastOne = mkdirs( parent, scmRepository );
             }
 
             basedir.mkdir();
 
-            // TODO: ewwww
-            if ( !new File( basedir, ".svn" ).exists() && !new File( basedir, "CVS"
).exists() )
+            if ( reservedScmFile != null && !new File( basedir, reservedScmFile ).exists()
)
             {
-                ScmProvider scmProvider = scmManager.getProviderByRepository( scmRepository
);
                 scmProvider.add( scmRepository, new ScmFileSet( parent, basedir ) );
+
                 lastOne = basedir;
             }
         }
@@ -325,9 +337,11 @@
             File scmFile = new File( checkoutDirectory, resourceName );
             File basedir = scmFile.getParentFile();
 
-            // TODO: ewwww
             ScmProvider scmProvider = scmManager.getProviderByRepository( scmRepository );
-            if ( new File( basedir, ".svn" ).exists() || new File( basedir, "CVS" ).exists()
)
+
+            String reservedScmFile = scmProvider.getScmSpecificFilename();
+
+            if ( reservedScmFile != null && new File( basedir, reservedScmFile ).exists()
)
             {
                 scmProvider.update( scmRepository, new ScmFileSet( basedir ), null );
             }
@@ -335,6 +349,7 @@
             {
                 // TODO: this should be checking out a full hierachy (requires the -d equiv)
                 basedir.mkdirs();
+
                 scmProvider.checkOut( scmRepository, new ScmFileSet( basedir ), null );
             }
 



Mime
View raw message