maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r391979 - in /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/checkout/ main/java/org/apache/maven/scm/provider/svn/svnexe/command/diff/ m...
Date Thu, 06 Apr 2006 13:27:16 GMT
Author: evenisse
Date: Thu Apr  6 06:27:14 2006
New Revision: 391979

URL: http://svn.apache.org/viewcvs?rev=391979&view=rev
Log:
Use StringUtils.isNotEmpty() instead of null check

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/checkout/SvnCheckOutCommand.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/diff/SvnDiffCommand.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/tag/SvnTagCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommandTest.java

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/checkout/SvnCheckOutCommand.java
URL: http://svn.apache.org/viewcvs/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/checkout/SvnCheckOutCommand.java?rev=391979&r1=391978&r2=391979&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/checkout/SvnCheckOutCommand.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/checkout/SvnCheckOutCommand.java
Thu Apr  6 06:27:14 2006
@@ -25,6 +25,7 @@
 import org.apache.maven.scm.provider.svn.command.SvnCommand;
 import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
 import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils;
+import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.cli.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
@@ -45,7 +46,8 @@
         SvnScmProviderRepository repository = (SvnScmProviderRepository) repo;
 
         String url = repository.getUrl();
-        if ( tag != null )
+
+        if ( tag != null && StringUtils.isNotEmpty( tag.trim() ) )
         {
             url = SvnTagBranchUtils.resolveTagUrl( repository, tag );
         }
@@ -90,7 +92,7 @@
 
         cl.createArgument().setValue( "checkout" );
 
-        if ( revision != null )
+        if ( StringUtils.isNotEmpty( revision ) )
         {
             cl.createArgument().setValue( "-r" );
 

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/diff/SvnDiffCommand.java
URL: http://svn.apache.org/viewcvs/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/diff/SvnDiffCommand.java?rev=391979&r1=391978&r2=391979&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/diff/SvnDiffCommand.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/diff/SvnDiffCommand.java
Thu Apr  6 06:27:14 2006
@@ -25,6 +25,7 @@
 import org.apache.maven.scm.provider.svn.command.diff.SvnDiffConsumer;
 import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
 import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils;
+import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.cli.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
@@ -84,11 +85,11 @@
 
         cl.createArgument().setValue( "diff" );
 
-        if ( startRevision != null )
+        if ( StringUtils.isNotEmpty( startRevision ) )
         {
             cl.createArgument().setValue( "-r" );
 
-            if ( endRevision != null )
+            if ( StringUtils.isNotEmpty( endRevision ) )
             {
                 cl.createArgument().setValue( startRevision + ":" + endRevision );
             }

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/tag/SvnTagCommand.java
URL: http://svn.apache.org/viewcvs/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/tag/SvnTagCommand.java?rev=391979&r1=391978&r2=391979&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/tag/SvnTagCommand.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/tag/SvnTagCommand.java
Thu Apr  6 06:27:14 2006
@@ -29,6 +29,7 @@
 import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
 import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils;
 import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.cli.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
@@ -51,7 +52,7 @@
     public ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String
tag )
         throws ScmException
     {
-        if ( tag == null )
+        if ( tag == null || StringUtils.isEmpty( tag.trim() ) )
         {
             throw new ScmException( "tag must be specified" );
         }
@@ -104,7 +105,9 @@
         }
 
         List fileList = new ArrayList();
+
         List files = null;
+
         try
         {
             files = FileUtils.getFiles( fileSet.getBasedir(), "**", "**/.svn/**", false );
@@ -117,6 +120,7 @@
         for ( Iterator i = files.iterator(); i.hasNext(); )
         {
             File f = (File) i.next();
+
             fileList.add( new ScmFile( f.getPath(), ScmFileStatus.TAGGED ) );
         }
 

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommandTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommandTest.java?rev=391979&r1=391978&r2=391979&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommandTest.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommandTest.java
Thu Apr  6 06:27:14 2006
@@ -60,7 +60,7 @@
         throws Exception
     {
         testCommandLine( getScmManager(), "scm:svn:http://foo.com/svn/trunk", "",
-                         "svn --non-interactive checkout -r  http://foo.com/svn/trunk " +
workingDirectory.getName() );
+                         "svn --non-interactive checkout http://foo.com/svn/trunk " + workingDirectory.getName()
);
     }
 
     public void testCommandLineWithRevision()



Mime
View raw message