maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1352065 - in /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src: main/java/org/apache/maven/scm/provider/perforce/command/checkin/ main/java/org/apache/maven/scm/provider/perforce/command/edit/ test/java/org/apache/maven/...
Date Wed, 20 Jun 2012 12:36:08 GMT
Author: olamy
Date: Wed Jun 20 12:36:08 2012
New Revision: 1352065

URL: http://svn.apache.org/viewvc?rev=1352065&view=rev
Log:
format code

Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/edit/PerforceEditCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInCommandTest.java

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInCommand.java?rev=1352065&r1=1352064&r2=1352065&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInCommand.java
Wed Jun 20 12:36:08 2012
@@ -19,13 +19,6 @@ package org.apache.maven.scm.provider.pe
  * under the License.
  */
 
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmVersion;
@@ -39,6 +32,13 @@ import org.codehaus.plexus.util.cli.Comm
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
 /**
  * @author Mike Perham
  * @version $Id$
@@ -138,8 +138,14 @@ public class PerforceCheckInCommand
             for ( int i = 0; i < fs.size(); i++ )
             {
                 File file = null;
-                if(fs.get( i ).isAbsolute()) file = new File( fs.get( i ).getPath() );
-                else file = new File( workingDir, fs.get( i ).getPath() );
+                if ( fs.get( i ).isAbsolute() )
+                {
+                    file = new File( fs.get( i ).getPath() );
+                }
+                else
+                {
+                    file = new File( workingDir, fs.get( i ).getPath() );
+                }
                 // XXX Submit requires the canonical repository path for each
                 // file.
                 // It is unclear how to get that from a File object.

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/edit/PerforceEditCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/edit/PerforceEditCommand.java?rev=1352065&r1=1352064&r2=1352065&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/edit/PerforceEditCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/edit/PerforceEditCommand.java
Wed Jun 20 12:36:08 2012
@@ -19,10 +19,6 @@ package org.apache.maven.scm.provider.pe
  * under the License.
  */
 
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmResult;
@@ -36,6 +32,10 @@ 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.List;
+
 /**
  * @author Mike Perham
  * @version $Id$
@@ -44,7 +44,9 @@ public class PerforceEditCommand
     extends AbstractEditCommand
     implements PerforceCommand
 {
-    /** {@inheritDoc} */
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected ScmResult executeEditCommand( ScmProviderRepository repo, ScmFileSet files
)
         throws ScmException
@@ -102,8 +104,14 @@ public class PerforceEditCommand
             for ( int i = 0; i < fs.size(); i++ )
             {
                 File file = null;
-                if(fs.get( i ).isAbsolute()) file = new File( fs.get( i ).getPath() );
-                else file = new File( workingDirectory, fs.get( i ).getPath() );
+                if ( fs.get( i ).isAbsolute() )
+                {
+                    file = new File( fs.get( i ).getPath() );
+                }
+                else
+                {
+                    file = new File( workingDirectory, fs.get( i ).getPath() );
+                }
                 // I want to use relative paths to add files to make testing
                 // simpler.
                 // Otherwise the absolute path will be different on everyone's

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInCommandTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInCommandTest.java?rev=1352065&r1=1352064&r2=1352065&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInCommandTest.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInCommandTest.java
Wed Jun 20 12:36:08 2012
@@ -19,15 +19,15 @@ package org.apache.maven.scm.provider.pe
  * under the License.
  */
 
-import java.io.File;
-import java.util.Arrays;
-
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmTestCase;
 import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository;
 import org.apache.maven.scm.repository.ScmRepository;
 import org.codehaus.plexus.util.cli.Commandline;
 
+import java.io.File;
+import java.util.Arrays;
+
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -37,38 +37,39 @@ public class PerforceCheckInCommandTest
     extends ScmTestCase
 {
     private static final File workingDirectory = getTestFile( "target/perforce-checkin-command-test"
);
+
     private static final String cmdPrefix = "p4 -d " + workingDirectory.getAbsolutePath();
 
     public void testGetCommandLine()
         throws Exception
     {
-        ScmFileSet files = new ScmFileSet( new File( "." ),
-                Arrays.asList( new File[] { new File( "foo.xml" ), new File( "bar.xml" )
} ) );
+        ScmFileSet files = new ScmFileSet( new File( "." ), Arrays.asList(
+            new File[]{ new File( "foo.xml" ), new File( "bar.xml" ) } ) );
         testCommandLine( "scm:perforce://depot/projects/pathname", cmdPrefix + " submit -i",
files );
     }
 
     public void testGetCommandLineAbsolutePaths()
-            throws Exception
-        {
-            ScmFileSet files = new ScmFileSet( new File( "." ).getAbsoluteFile(),
-                    Arrays.asList( new File[] { new File( "foo.xml" ).getAbsoluteFile(),
new File( "bar.xml" ).getAbsoluteFile() } ) );
-            testCommandLine( "scm:perforce://depot/projects/pathname", cmdPrefix + " submit
-i", files );
-        }
+        throws Exception
+    {
+        ScmFileSet files = new ScmFileSet( new File( "." ).getAbsoluteFile(), Arrays.asList(
+            new File[]{ new File( "foo.xml" ).getAbsoluteFile(), new File( "bar.xml" ).getAbsoluteFile()
} ) );
+        testCommandLine( "scm:perforce://depot/projects/pathname", cmdPrefix + " submit -i",
files );
+    }
 
     public void testGetCommandLineWithHost()
         throws Exception
     {
-        ScmFileSet files = new ScmFileSet( new File( "." ),
-                Arrays.asList( new File[] { new File( "foo.xml" ), new File( "bar.xml" )
} ) );
-        testCommandLine( "scm:perforce:a:username@//depot/projects/pathname",
-                cmdPrefix + " -p a -u username submit -i", files );
+        ScmFileSet files = new ScmFileSet( new File( "." ), Arrays.asList(
+            new File[]{ new File( "foo.xml" ), new File( "bar.xml" ) } ) );
+        testCommandLine( "scm:perforce:a:username@//depot/projects/pathname", cmdPrefix +
" -p a -u username submit -i",
+                         files );
     }
 
     public void testGetCommandLineWithHostAndPort()
         throws Exception
     {
-        ScmFileSet files = new ScmFileSet( new File( "." ),
-                Arrays.asList( new File[] { new File( "foo.xml" ), new File( "bar.xml" )
} ) );
+        ScmFileSet files = new ScmFileSet( new File( "." ), Arrays.asList(
+            new File[]{ new File( "foo.xml" ), new File( "bar.xml" ) } ) );
         testCommandLine( "scm:perforce:myhost:1234:username@//depot/projects/pathname",
                          cmdPrefix + " -p myhost:1234 -u username submit -i", files );
     }



Mime
View raw message