Author: carlos
Date: Mon May  1 14:21:38 2006
New Revision: 398693

URL: http://svn.apache.org/viewcvs?rev=398693&view=rev
Log:
Add workaround for problem with svn:eol-style=native property

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=398693&r1=398692&r2=398693&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
 Mon May  1 14:21:38 2006
@@ -184,7 +184,7 @@
 
             File basedir = scmFile.getParentFile();
 
-            String msg = "Wagon: Adding " + scmFile.getName() + " to 
repository";
+            String msg = "Wagon: Adding " + source.getName() + " to 
repository";
 
             ScmProvider scmProvider = scmManager.getProviderByRepository( 
scmRepository );
 
@@ -276,6 +276,17 @@
         File scmFile = new File( basedir, scmFilePath );
 
         AddScmResult result = scmProvider.add( scmRepository, new ScmFileSet( 
basedir, new File( scmFilePath ) ) );
+
+        /* 
+         * TODO dirty fix to work around files with property 
svn:eol-style=native
+         * if a file has that property, first time file is added it fails, 
second time it succeeds
+         * the solution is check if the scm provider is svn and unset that 
property
+         * when the SCM API allows it 
+         */
+        if ( !result.isSuccess() )
+        {
+            result = scmProvider.add( scmRepository, new ScmFileSet( basedir, 
new File( scmFilePath ) ) );
+        }
 
         int addedFiles = result.getAddedFiles().size();
 


Reply via email to