maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1054399 - in /maven/scm/trunk: maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/ maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/ maven-scm-providers/maven-scm-providers-cvs...
Date Sun, 02 Jan 2011 13:19:52 GMT
Author: olamy
Date: Sun Jan  2 13:19:52 2011
New Revision: 1054399

URL: http://svn.apache.org/viewvc?rev=1054399&view=rev
Log:
[SCM-591] move to Java 1.5 : branch command

Modified:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/BranchScmResult.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsBranchCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/branch/CvsExeBranchCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/branch/CvsJavaBranchCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/AbstractFileCheckingConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/list/GitListConsumer.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

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/BranchScmResult.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/BranchScmResult.java?rev=1054399&r1=1054398&r2=1054399&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/BranchScmResult.java
(original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/BranchScmResult.java
Sun Jan  2 13:19:52 2011
@@ -19,39 +19,45 @@ package org.apache.maven.scm.command.bra
  * under the License.
  */
 
-import org.apache.maven.scm.ScmResult;
-
 import java.util.List;
 
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmResult;
+
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @author Olivier Lamy
  * @version $Id$
  */
 public class BranchScmResult
     extends ScmResult
 {
-    private List branchedFiles;
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -4241972929129557932L;
+    private List<ScmFile> branchedFiles;
 
     public BranchScmResult( String commandLine, String providerMessage, String commandOutput,
boolean success )
     {
         super( commandLine, providerMessage, commandOutput, success );
     }
 
-    public BranchScmResult( String commandLine, List branchedFiles )
+    public BranchScmResult( String commandLine, List<ScmFile> branchedFiles )
     {
         super( commandLine, null, null, true );
 
         this.branchedFiles = branchedFiles;
     }
 
-    public BranchScmResult( List branchedFiles, ScmResult result )
+    public BranchScmResult( List<ScmFile> branchedFiles, ScmResult result )
     {
         super( result );
 
         this.branchedFiles = branchedFiles;
     }
 
-    public List getBranchedFiles()
+    public List<ScmFile> getBranchedFiles()
     {
         return branchedFiles;
     }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsBranchCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsBranchCommand.java?rev=1054399&r1=1054398&r2=1054399&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsBranchCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsBranchCommand.java
Sun Jan  2 13:19:52 2011
@@ -22,6 +22,7 @@ package org.apache.maven.scm.provider.tf
 import java.util.ArrayList;
 
 import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmResult;
 import org.apache.maven.scm.command.branch.AbstractBranchCommand;
@@ -46,7 +47,7 @@ public class TfsBranchCommand
             return new BranchScmResult( command.getCommandString(), "Error code for TFS branch
command - " + status,
                                         err.getOutput(), false );
         }
-        return new BranchScmResult( command.getCommandString(), new ArrayList() );
+        return new BranchScmResult( command.getCommandString(), new ArrayList<ScmFile>(
0 ) );
     }
 
     public TfsCommand createCommand( ScmProviderRepository r, ScmFileSet f, String branch
)

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagConsumer.java?rev=1054399&r1=1054398&r2=1054399&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagConsumer.java
Sun Jan  2 13:19:52 2011
@@ -30,6 +30,7 @@ import java.util.List;
 
 /**
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ * @author Olivier Lamy
  * @version $Id$
  */
 public class CvsTagConsumer
@@ -37,7 +38,7 @@ public class CvsTagConsumer
 {
     private ScmLogger logger;
 
-    private List files = new ArrayList();
+    private List<ScmFile> files = new ArrayList<ScmFile>();
 
     public CvsTagConsumer( ScmLogger logger )
     {
@@ -82,7 +83,7 @@ public class CvsTagConsumer
         }
     }
 
-    public List getTaggedFiles()
+    public List<ScmFile> getTaggedFiles()
     {
         return files;
     }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/branch/CvsExeBranchCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/branch/CvsExeBranchCommand.java?rev=1054399&r1=1054398&r2=1054399&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/branch/CvsExeBranchCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/branch/CvsExeBranchCommand.java
Sun Jan  2 13:19:52 2011
@@ -29,6 +29,7 @@ import org.codehaus.plexus.util.cli.Comm
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @author Olivier Lamy
  * @version $Id$
  */
 public class CvsExeBranchCommand

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/branch/CvsJavaBranchCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/branch/CvsJavaBranchCommand.java?rev=1054399&r1=1054398&r2=1054399&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/branch/CvsJavaBranchCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/branch/CvsJavaBranchCommand.java
Sun Jan  2 13:19:52 2011
@@ -33,6 +33,7 @@ import java.io.InputStreamReader;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @author Olivier Lamy
  * @version $Id$
  */
 public class CvsJavaBranchCommand
@@ -69,7 +70,7 @@ public class CvsJavaBranchCommand
         }
         catch ( Exception e )
         {
-            e.printStackTrace();
+            getLogger().error( e.getMessage(), e );
             return new BranchScmResult( cl.toString(), "The cvs branch command failed.",
                                         logListener.getStderr().toString(), false );
         }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/AbstractFileCheckingConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/AbstractFileCheckingConsumer.java?rev=1054399&r1=1054398&r2=1054399&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/AbstractFileCheckingConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/AbstractFileCheckingConsumer.java
Sun Jan  2 13:19:52 2011
@@ -30,6 +30,7 @@ import java.util.List;
 
 /**
  * @author <a href="mailto:kenney@apache.org">Kenney Westerhof</a>
+ * @author Olivier Lamy
  * @version $Id$
  */
 public abstract class AbstractFileCheckingConsumer
@@ -39,7 +40,7 @@ public abstract class AbstractFileChecki
 
     protected File workingDirectory;
 
-    private List files = new ArrayList();
+    private List<ScmFile> files = new ArrayList<ScmFile>();
 
     protected int revision;
 
@@ -69,13 +70,13 @@ public abstract class AbstractFileChecki
 
     protected abstract void parseLine( String line );
 
-    protected List getFiles()
+    protected List<ScmFile> getFiles()
     {
         if ( !filtered )
         {
-            for ( Iterator it = files.iterator(); it.hasNext(); )
+            for ( Iterator<ScmFile> it = files.iterator(); it.hasNext(); )
             {
-                if ( !new File( workingDirectory, ( (ScmFile) it.next() ).getPath() ).isFile()
)
+                if ( !new File( workingDirectory, it.next().getPath() ).isFile() )
                 {
                     it.remove();
                 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/list/GitListConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/list/GitListConsumer.java?rev=1054399&r1=1054398&r2=1054399&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/list/GitListConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/list/GitListConsumer.java
Sun Jan  2 13:19:52 2011
@@ -29,6 +29,7 @@ import java.util.List;
 
 /**
  * @author <a href="mailto:struberg@yahoo.de">Mark Struberg</a>
+ * @author Olivier Lamy
  * @version $Id$
  */
 public class GitListConsumer
@@ -60,7 +61,7 @@ public class GitListConsumer
     //
     // ----------------------------------------------------------------------
 
-    public List getListedFiles()
+    public List<ScmFile> getListedFiles()
     {
         return getFiles();
     }

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=1054399&r1=1054398&r2=1054399&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
Sun Jan  2 13:19:52 2011
@@ -19,6 +19,11 @@ package org.apache.maven.scm.provider.sv
  * under the License.
  */
 
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.maven.scm.ScmBranch;
 import org.apache.maven.scm.ScmBranchParameters;
 import org.apache.maven.scm.ScmException;
@@ -40,14 +45,9 @@ import org.codehaus.plexus.util.cli.Comm
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @author Olivier Lamy
  * @version $Id$
  * @todo since this is just a copy, use that instead.
  */
@@ -64,7 +64,7 @@ public class SvnBranchCommand
             throw new ScmException( "branch name must be specified" );
         }
 
-        if ( fileSet.getFiles().length != 0 )
+        if ( fileSet.getFileList().isEmpty() )
         {
             throw new ScmException( "This provider doesn't support branching subsets of a
directory" );
         }
@@ -122,23 +122,23 @@ public class SvnBranchCommand
             return new BranchScmResult( cl.toString(), "The svn branch command failed.",
stderr.getOutput(), false );
         }
 
-        List fileList = new ArrayList();
+        List<ScmFile> fileList = new ArrayList<ScmFile>();
 
-        List files = null;
+        List<File> files = null;
 
         try
         {
-            files = FileUtils.getFiles( fileSet.getBasedir(), "**", "**/.svn/**", false );
+            @SuppressWarnings( "unchecked" )
+            List<File> listFiles = FileUtils.getFiles( fileSet.getBasedir(), "**",
"**/.svn/**", false );
+            files = listFiles;
         }
         catch ( IOException e )
         {
             throw new ScmException( "Error while executing command.", e );
         }
 
-        for ( Iterator i = files.iterator(); i.hasNext(); )
+        for ( File f : files )
         {
-            File f = (File) i.next();
-
             fileList.add( new ScmFile( f.getPath(), ScmFileStatus.TAGGED ) );
         }
 



Mime
View raw message