maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r528416 - in /maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src: main/java/org/apache/maven/scm/provider/hg/ main/java/org/apache/maven/scm/provider/hg/command/ main/java/org/apache/maven/scm/provider/hg/command/add/ main/java/o...
Date Fri, 13 Apr 2007 09:59:41 GMT
Author: evenisse
Date: Fri Apr 13 02:59:40 2007
New Revision: 528416

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

Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgConfig.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgUtils.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/HgCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/HgConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/add/HgAddCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/changelog/HgChangeLogCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkin/HgCheckInCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/remove/HgRemoveCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/status/HgStatusCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/status/HgStatusConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/update/HgUpdateCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepository.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/HgTestUtils.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffCommandTckTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepositoryTest.java

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgConfig.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgConfig.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgConfig.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgConfig.java Fri Apr 13 02:59:40 2007
@@ -45,7 +45,7 @@
     // URL to download mercurial from
     private static final String HG_INSTALL_URL = "'http://www.selenic.com/mercurial/wiki/index.cgi/Download'";
 
-   //Configuration to check with default values (not installed)
+    //Configuration to check with default values (not installed)
     private HgVersionConsumer hgVersion = new HgVersionConsumer( null );
 
     HgConfig( File workingDir )
@@ -62,7 +62,7 @@
 
     }
 
-     /**
+    /**
      * @return True if one can run basic hg commands
      */
     private boolean isInstalled()
@@ -82,8 +82,8 @@
     public static HgVersionConsumer getHgVersion( File workingDir )
         throws ScmException
     {
-        String[] versionCmd = new String[] { HgCommand.VERSION };
-        HgVersionConsumer consumer = new HgVersionConsumer(HG_VERSION_TAG);
+        String[] versionCmd = new String[]{HgCommand.VERSION};
+        HgVersionConsumer consumer = new HgVersionConsumer( HG_VERSION_TAG );
         Commandline cmd = HgUtils.buildCmd( workingDir, versionCmd );
 
         // Execute command
@@ -95,14 +95,15 @@
 
 
     /**
-     *  Iterate through two dot-notation version strings, normalize them to the same length, then
+     * Iterate through two dot-notation version strings, normalize them to the same length, then
      * do alphabetic comparison
      *
      * @param version1
      * @param version2
      * @return true if version2 is greater than version1
      */
-    private static boolean CompareVersion( String version1, String version2) {
+    private static boolean CompareVersion( String version1, String version2 )
+    {
         int l1, l2, i;
         String v1, v2;
 
@@ -111,16 +112,22 @@
         l1 = version1.length();
         l2 = version2.length();
 
-        if (l1 > l2)
-            for (int x = l2; x >= l1; x--) {
+        if ( l1 > l2 )
+        {
+            for ( int x = l2; x >= l1; x-- )
+            {
                 v2 += ' ';
             }
-        if (l2 > l1)
-            for (int x = l1; x <= l2; x++) {
+        }
+        if ( l2 > l1 )
+        {
+            for ( int x = l1; x <= l2; x++ )
+            {
                 v1 += ' ';
             }
+        }
 
-        return v2.compareTo(v1) >= 0;
+        return v2.compareTo( v1 ) >= 0;
     }
 
 
@@ -130,7 +137,7 @@
      * the second last word.
      */
     private static class HgVersionConsumer
-            extends HgConsumer
+        extends HgConsumer
     {
 
         private String versionStr = "NA";
@@ -147,8 +154,8 @@
         {
             if ( line.startsWith( version_tag ) )
             {
-                String[] elements = line.split(" ");
-                versionStr = elements[elements.length - 1].split("\\)")[0];
+                String[] elements = line.split( " " );
+                versionStr = elements[elements.length - 1].split( "\\)" )[0];
             }
         }
 
@@ -161,10 +168,10 @@
         {
             // build one number out of the whole version #
 
-            return CompareVersion(version, versionStr);
+            return CompareVersion( version, versionStr );
         }
     }
-    
+
     private String getInstalledStr()
     {
         if ( isComplete() )
@@ -177,7 +184,7 @@
     public String toString( File workingDir )
     {
         boolean hgOk = hgVersion.isVersionOk( HG_REQ );
-        return "\n  Your Hg installation seems to be " + getInstalledStr() + "\n    Hg version: "
-            + hgVersion.getVersion() + ( hgOk ? " (OK)" : " (May be INVALID)" ) + "\n";
+        return "\n  Your Hg installation seems to be " + getInstalledStr() + "\n    Hg version: " +
+            hgVersion.getVersion() + ( hgOk ? " (OK)" : " (May be INVALID)" ) + "\n";
     }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgScmProvider.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgScmProvider.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgScmProvider.java Fri Apr 13 02:59:40 2007
@@ -19,7 +19,10 @@
  * under the License.
  */
 
-import org.apache.maven.scm.*;
+import org.apache.maven.scm.CommandParameters;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmResult;
 import org.apache.maven.scm.command.add.AddScmResult;
 import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
 import org.apache.maven.scm.command.checkin.CheckInScmResult;
@@ -40,7 +43,6 @@
 import org.apache.maven.scm.provider.hg.command.status.HgStatusCommand;
 import org.apache.maven.scm.provider.hg.command.update.HgUpdateCommand;
 import org.apache.maven.scm.provider.hg.repository.HgScmProviderRepository;
-import org.apache.maven.scm.repository.ScmRepository;
 import org.apache.maven.scm.repository.ScmRepositoryException;
 import org.apache.maven.scm.repository.UnknownRepositoryStructure;
 
@@ -50,11 +52,11 @@
 
 /**
  * Mercurial (HG) is a decentralized revision control system.
- * <a href="http://www.selenic.com/mercurial">http://www.selenic.com/mercurial</a> 
+ * <a href="http://www.selenic.com/mercurial">http://www.selenic.com/mercurial</a>
  *
  * @author <a href="mailto:thurner.rupert@ymono.net">thurner rupert</a>
  * @plexus.component role="org.apache.maven.scm.provider.ScmProvider"
- *                   role-hint="hg"
+ * role-hint="hg"
  */
 public class HgScmProvider
     extends AbstractScmProvider
@@ -96,7 +98,7 @@
 
         List errorMessages = new ArrayList();
 
-        String[] checkCmd = new String[] { HgCommand.CHECK, scmSpecificUrl };
+        String[] checkCmd = new String[]{HgCommand.CHECK, scmSpecificUrl};
         ScmResult result;
         try
         {
@@ -121,94 +123,110 @@
         return "hg";
     }
 
-    /** @see org.apache.maven.scm.provider.AbstractScmProvider#add(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters) */
-    public AddScmResult add(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
-            throws ScmException
+    /**
+     * @see org.apache.maven.scm.provider.AbstractScmProvider#add(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters)
+     */
+    public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
     {
         HgAddCommand command = new HgAddCommand();
 
-        command.setLogger(getLogger());
+        command.setLogger( getLogger() );
 
-        return (AddScmResult) command.execute(repository, fileSet, parameters);
+        return (AddScmResult) command.execute( repository, fileSet, parameters );
     }
 
-    /** @see org.apache.maven.scm.provider.AbstractScmProvider#changelog(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters) */
-    public ChangeLogScmResult changelog(ScmProviderRepository repository, ScmFileSet fileSet,
-                                        CommandParameters parameters)
-            throws ScmException
+    /**
+     * @see org.apache.maven.scm.provider.AbstractScmProvider#changelog(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters)
+     */
+    public ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet,
+                                         CommandParameters parameters )
+        throws ScmException
     {
         HgChangeLogCommand command = new HgChangeLogCommand();
 
-        command.setLogger(getLogger());
+        command.setLogger( getLogger() );
 
-        return (ChangeLogScmResult) command.execute(repository, fileSet, parameters);
+        return (ChangeLogScmResult) command.execute( repository, fileSet, parameters );
     }
 
-    /** @see org.apache.maven.scm.provider.AbstractScmProvider#checkin(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters) */
-    public CheckInScmResult checkin(ScmProviderRepository repository, ScmFileSet fileSet,
-                                    CommandParameters parameters)
-            throws ScmException
+    /**
+     * @see org.apache.maven.scm.provider.AbstractScmProvider#checkin(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters)
+     */
+    public CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet,
+                                     CommandParameters parameters )
+        throws ScmException
     {
         HgCheckInCommand command = new HgCheckInCommand();
 
-        command.setLogger(getLogger());
+        command.setLogger( getLogger() );
 
-        return (CheckInScmResult) command.execute(repository, fileSet, parameters);
+        return (CheckInScmResult) command.execute( repository, fileSet, parameters );
     }
 
-    /** @see org.apache.maven.scm.provider.AbstractScmProvider#checkout(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters) */
-    public CheckOutScmResult checkout(ScmProviderRepository repository, ScmFileSet fileSet,
-                                      CommandParameters parameters)
-            throws ScmException
+    /**
+     * @see org.apache.maven.scm.provider.AbstractScmProvider#checkout(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters)
+     */
+    public CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet,
+                                       CommandParameters parameters )
+        throws ScmException
     {
         HgCheckOutCommand command = new HgCheckOutCommand();
 
-        command.setLogger(getLogger());
+        command.setLogger( getLogger() );
 
-        return (CheckOutScmResult) command.execute(repository, fileSet, parameters);
+        return (CheckOutScmResult) command.execute( repository, fileSet, parameters );
     }
 
-    /** @see org.apache.maven.scm.provider.AbstractScmProvider#diff(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters) */
-    public DiffScmResult diff(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
-            throws ScmException
+    /**
+     * @see org.apache.maven.scm.provider.AbstractScmProvider#diff(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters)
+     */
+    public DiffScmResult diff( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
     {
         HgDiffCommand command = new HgDiffCommand();
 
-        command.setLogger(getLogger());
+        command.setLogger( getLogger() );
 
-        return (DiffScmResult) command.execute(repository, fileSet, parameters);
+        return (DiffScmResult) command.execute( repository, fileSet, parameters );
     }
 
-    /** @see org.apache.maven.scm.provider.AbstractScmProvider#remove(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters) */
-    public RemoveScmResult remove(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
-            throws ScmException
+    /**
+     * @see org.apache.maven.scm.provider.AbstractScmProvider#remove(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters)
+     */
+    public RemoveScmResult remove( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
     {
         HgRemoveCommand command = new HgRemoveCommand();
 
-        command.setLogger(getLogger());
+        command.setLogger( getLogger() );
 
-        return (RemoveScmResult) command.execute(repository, fileSet, parameters);
+        return (RemoveScmResult) command.execute( repository, fileSet, parameters );
     }
 
-    /** @see org.apache.maven.scm.provider.AbstractScmProvider#status(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters) */
-    public StatusScmResult status(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
-            throws ScmException
+    /**
+     * @see org.apache.maven.scm.provider.AbstractScmProvider#status(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters)
+     */
+    public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
     {
         HgStatusCommand command = new HgStatusCommand();
 
-        command.setLogger(getLogger());
+        command.setLogger( getLogger() );
 
-        return (StatusScmResult) command.execute(repository, fileSet, parameters);
+        return (StatusScmResult) command.execute( repository, fileSet, parameters );
     }
 
-    /** @see org.apache.maven.scm.provider.AbstractScmProvider#update(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters) */
-    public UpdateScmResult update(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
-            throws ScmException
+    /**
+     * @see org.apache.maven.scm.provider.AbstractScmProvider#update(org.apache.maven.scm.provider.ScmProviderRepository,org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.CommandParameters)
+     */
+    public UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
     {
         HgUpdateCommand command = new HgUpdateCommand();
 
-        command.setLogger(getLogger());
+        command.setLogger( getLogger() );
 
-        return (UpdateScmResult) command.execute(repository, fileSet, parameters);
+        return (UpdateScmResult) command.execute( repository, fileSet, parameters );
     }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgUtils.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgUtils.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgUtils.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgUtils.java Fri Apr 13 02:59:40 2007
@@ -19,7 +19,10 @@
  * under the License.
  */
 
-import org.apache.maven.scm.*;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.ScmResult;
 import org.apache.maven.scm.log.DefaultLog;
 import org.apache.maven.scm.log.ScmLogger;
 import org.apache.maven.scm.provider.hg.command.HgCommand;
@@ -29,7 +32,11 @@
 import org.codehaus.plexus.util.cli.Commandline;
 
 import java.io.File;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 
 /**
  * Common code for executing hg commands.
@@ -86,9 +93,9 @@
             if ( !success )
             {
                 HgConfig config = new HgConfig( workingDir );
-                providerMsg = "\nEXECUTION FAILED" + "\n  Execution of cmd : " + cmdAndArgs[0]
-                    + " failed with exit code: " + exitCode + "." + "\n  Working directory was: " + "\n    "
-                    + workingDir.getAbsolutePath() + config.toString( workingDir ) + "\n";
+                providerMsg = "\nEXECUTION FAILED" + "\n  Execution of cmd : " + cmdAndArgs[0] +
+                    " failed with exit code: " + exitCode + "." + "\n  Working directory was: " + "\n    " +
+                    workingDir.getAbsolutePath() + config.toString( workingDir ) + "\n";
                 logger.error( providerMsg );
             }
 
@@ -96,8 +103,8 @@
         }
         catch ( ScmException se )
         {
-            String msg = "EXECUTION FAILED" + "\n  Execution failed before invoking the Hg command. Last exception:"
-                + "\n    " + se.getMessage();
+            String msg = "EXECUTION FAILED" + "\n  Execution failed before invoking the Hg command. Last exception:" +
+                "\n    " + se.getMessage();
 
             //Add nested cause if any
             if ( se.getCause() != null )
@@ -162,14 +169,15 @@
         System.arraycopy( cmdAndArgs, 0, cmd, 0, cmdAndArgs.length );
 
         // Add files as additional parameter into the array
-        int i =0;
-        for (Iterator iterator = filesList.iterator(); iterator.hasNext(); i++) {
+        int i = 0;
+        for ( Iterator iterator = filesList.iterator(); iterator.hasNext(); i++ )
+        {
             File scmFile = (File) iterator.next();
-            String file = scmFile.getPath().replace('\\', File.separatorChar);
+            String file = scmFile.getPath().replace( '\\', File.separatorChar );
             cmd[i + cmdAndArgs.length] = file;
 
         }
-        
+
         return cmd;
     }
 
@@ -177,7 +185,7 @@
         throws ScmException
     {
 
-        String[] revCmd = new String[] { HgCommand.REVNO_CMD };
+        String[] revCmd = new String[]{HgCommand.REVNO_CMD};
         HgRevNoConsumer consumer = new HgRevNoConsumer( logger );
         HgUtils.execute( consumer, logger, workingDir, revCmd );
 

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/HgCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/HgCommand.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/HgCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/HgCommand.java Fri Apr 13 02:59:40 2007
@@ -100,7 +100,7 @@
     /**
      * no recurse option does not exist in mercurial
      */
-    public static final String NO_RECURSE_OPTION = ""; 
+    public static final String NO_RECURSE_OPTION = "";
 
     public static final String MESSAGE_OPTION = "--message";
 

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/HgConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/HgConsumer.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/HgConsumer.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/HgConsumer.java Fri Apr 13 02:59:40 2007
@@ -77,11 +77,11 @@
          *  TODO "! deleted but still tracked"
          *  d 
          */
-        identifiers.put( "A", ScmFileStatus.ADDED);
-        identifiers.put( "?", ScmFileStatus.UNKNOWN);
-        identifiers.put( "M", ScmFileStatus.MODIFIED);
-        identifiers.put( "R", ScmFileStatus.DELETED);
-        identifiers.put( "I", ScmFileStatus.UNKNOWN); // not precisely the same, but i think semantics work? - rwd
+        identifiers.put( "A", ScmFileStatus.ADDED );
+        identifiers.put( "?", ScmFileStatus.UNKNOWN );
+        identifiers.put( "M", ScmFileStatus.MODIFIED );
+        identifiers.put( "R", ScmFileStatus.DELETED );
+        identifiers.put( "I", ScmFileStatus.UNKNOWN ); // not precisely the same, but i think semantics work? - rwd
 
         messages.put( "hg: WARNING:", "WARNING" );
         messages.put( "hg: ERROR:", "ERROR" );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/add/HgAddCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/add/HgAddCommand.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/add/HgAddCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/add/HgAddCommand.java Fri Apr 13 02:59:40 2007
@@ -45,7 +45,7 @@
         throws ScmException
     {
         //String[] addCmd = new String[] { ADD_CMD, NO_RECURSE_OPTION };
-        String[] addCmd = new String[] { ADD_CMD, VERBOSE_OPTION };
+        String[] addCmd = new String[]{ADD_CMD, VERBOSE_OPTION};
         addCmd = HgUtils.expandCommandLine( addCmd, fileSet );
 
         File workingDir = fileSet.getBasedir();
@@ -59,8 +59,8 @@
         for ( Iterator iterator = fileSet.getFileList().iterator(); iterator.hasNext(); )
         {
             File workingFile = (File) iterator.next();
-            File file = new File(workingDir + "/" + workingFile.getPath());
-            if (file.isDirectory() && file.listFiles().length == 0)
+            File file = new File( workingDir + "/" + workingFile.getPath() );
+            if ( file.isDirectory() && file.listFiles().length == 0 )
             {
                 addScmResult.getAddedFiles().add( workingFile );
             }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/changelog/HgChangeLogCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/changelog/HgChangeLogCommand.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/changelog/HgChangeLogCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/changelog/HgChangeLogCommand.java Fri Apr 13 02:59:40 2007
@@ -19,7 +19,11 @@
  * under the License.
  */
 
-import org.apache.maven.scm.*;
+import org.apache.maven.scm.ChangeSet;
+import org.apache.maven.scm.ScmBranch;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmResult;
 import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand;
 import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
 import org.apache.maven.scm.command.changelog.ChangeLogSet;
@@ -39,27 +43,34 @@
     extends AbstractChangeLogCommand
     implements HgCommand
 {
- 
-    protected ChangeLogScmResult executeChangeLogCommand(ScmProviderRepository scmProviderRepository, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern) throws ScmException
+
+    protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository scmProviderRepository,
+                                                          ScmFileSet fileSet, Date startDate, Date endDate,
+                                                          ScmBranch branch, String datePattern )
+        throws ScmException
     {
         String[] cmd = new String[]{LOG_CMD, VERBOSE_OPTION};
-        HgChangeLogConsumer consumer = new HgChangeLogConsumer(getLogger(), datePattern);
-        ScmResult result = HgUtils.execute(consumer, getLogger(), fileSet.getBasedir(), cmd);
+        HgChangeLogConsumer consumer = new HgChangeLogConsumer( getLogger(), datePattern );
+        ScmResult result = HgUtils.execute( consumer, getLogger(), fileSet.getBasedir(), cmd );
 
         List logEntries = consumer.getModifications();
         List inRangeAndValid = new ArrayList();
-        startDate = startDate == null ? new Date(0) : startDate;//From 1. Jan 1970
+        startDate = startDate == null ? new Date( 0 ) : startDate;//From 1. Jan 1970
         endDate = endDate == null ? new Date() : endDate;//Upto now
 
-        for (Iterator it = logEntries.iterator(); it.hasNext();) {
+        for ( Iterator it = logEntries.iterator(); it.hasNext(); )
+        {
             ChangeSet change = (ChangeSet) it.next();
-            if (change.getFiles().size() > 0) {
-                if (!change.getDate().before(startDate) && !change.getDate().after(endDate)) {
-                    inRangeAndValid.add(change);
+            if ( change.getFiles().size() > 0 )
+            {
+                if ( !change.getDate().before( startDate ) && !change.getDate().after( endDate ) )
+                {
+                    inRangeAndValid.add( change );
                 }
             }
         }
 
-        ChangeLogSet changeLogSet = new ChangeLogSet(inRangeAndValid, startDate, endDate);
-        return new ChangeLogScmResult(changeLogSet, result);    }
+        ChangeLogSet changeLogSet = new ChangeLogSet( inRangeAndValid, startDate, endDate );
+        return new ChangeLogScmResult( changeLogSet, result );
+    }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkin/HgCheckInCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkin/HgCheckInCommand.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkin/HgCheckInCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkin/HgCheckInCommand.java Fri Apr 13 02:59:40 2007
@@ -19,7 +19,12 @@
  * under the License.
  */
 
-import org.apache.maven.scm.*;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.ScmVersion;
 import org.apache.maven.scm.command.checkin.AbstractCheckInCommand;
 import org.apache.maven.scm.command.checkin.CheckInScmResult;
 import org.apache.maven.scm.command.status.StatusScmResult;
@@ -40,10 +45,12 @@
  * @author <a href="mailto:thurner.rupert@ymono.net">thurner rupert</a>
  */
 public class HgCheckInCommand
-        extends AbstractCheckInCommand
+    extends AbstractCheckInCommand
 {
 
-    protected CheckInScmResult executeCheckInCommand(ScmProviderRepository repo, ScmFileSet fileSet, String message, ScmVersion tag) throws ScmException
+    protected CheckInScmResult executeCheckInCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message,
+                                                      ScmVersion tag )
+        throws ScmException
     {
         if ( tag != null && !StringUtils.isEmpty( tag.getName() ) )
         {
@@ -62,8 +69,8 @@
             for ( Iterator it = statusFiles.iterator(); it.hasNext(); )
             {
                 ScmFile file = (ScmFile) it.next();
-                if ( file.getStatus() == ScmFileStatus.ADDED || file.getStatus() == ScmFileStatus.DELETED
-                     || file.getStatus() == ScmFileStatus.MODIFIED )
+                if ( file.getStatus() == ScmFileStatus.ADDED || file.getStatus() == ScmFileStatus.DELETED ||
+                    file.getStatus() == ScmFileStatus.MODIFIED )
                 {
                     commitedFiles.add( new ScmFile( file.getPath(), ScmFileStatus.CHECKED_IN ) );
                 }
@@ -79,18 +86,17 @@
         }
 
         // Commit to local branch
-        String[] commitCmd = new String[] { HgCommand.COMMIT_CMD, HgCommand.MESSAGE_OPTION, message };
+        String[] commitCmd = new String[]{HgCommand.COMMIT_CMD, HgCommand.MESSAGE_OPTION, message};
         commitCmd = HgUtils.expandCommandLine( commitCmd, fileSet );
-        ScmResult result = HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), fileSet.getBasedir(),
-                                            commitCmd );
+        ScmResult result =
+            HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), fileSet.getBasedir(), commitCmd );
 
         // Push to parent branch if any
         HgScmProviderRepository repository = (HgScmProviderRepository) repo;
         if ( !repository.getURI().equals( fileSet.getBasedir().getAbsolutePath() ) )
         {
-            String[] push_cmd = new String[] { HgCommand.PUSH_CMD, repository.getURI() };
-            result = HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), fileSet.getBasedir(),
-                                      push_cmd );
+            String[] push_cmd = new String[]{HgCommand.PUSH_CMD, repository.getURI()};
+            result = HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), fileSet.getBasedir(), push_cmd );
         }
 
         return new CheckInScmResult( commitedFiles, result );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java Fri Apr 13 02:59:40 2007
@@ -44,30 +44,37 @@
     implements HgCommand
 {
 
-   
-    protected CheckOutScmResult executeCheckOutCommand(ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion scmVersion) throws ScmException
+
+    protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
+                                                        ScmVersion scmVersion )
+        throws ScmException
     {
         HgScmProviderRepository repository = (HgScmProviderRepository) repo;
         String url = repository.getURI();
 
         File checkoutDir = fileSet.getBasedir();
-        try {
-            getLogger().info("Removing " + checkoutDir);
-            FileUtils.deleteDirectory(checkoutDir);
+        try
+        {
+            getLogger().info( "Removing " + checkoutDir );
+            FileUtils.deleteDirectory( checkoutDir );
         }
-        catch (IOException e) {
-            throw new ScmException("Cannot remove " + checkoutDir);
+        catch ( IOException e )
+        {
+            throw new ScmException( "Cannot remove " + checkoutDir );
         }
 
         // Do the actual checkout
-        String[] checkout_cmd = new String[]{BRANCH_CMD,  REVISION_OPTION, scmVersion != null && !StringUtils.isEmpty(scmVersion.getName()) ? scmVersion.getName() : "tip", url, checkoutDir.getAbsolutePath()};
-        HgConsumer checkout_consumer = new HgConsumer(getLogger());
-        HgUtils.execute(checkout_consumer, getLogger(), checkoutDir.getParentFile(), checkout_cmd);
+        String[] checkout_cmd = new String[]{BRANCH_CMD, REVISION_OPTION,
+            scmVersion != null && !StringUtils.isEmpty( scmVersion.getName() ) ? scmVersion.getName() : "tip", url,
+            checkoutDir.getAbsolutePath()};
+        HgConsumer checkout_consumer = new HgConsumer( getLogger() );
+        HgUtils.execute( checkout_consumer, getLogger(), checkoutDir.getParentFile(), checkout_cmd );
 
         // Do inventory to find list of checkedout files
         String[] inventory_cmd = new String[]{INVENTORY_CMD};
-        HgCheckOutConsumer consumer = new HgCheckOutConsumer(getLogger(), checkoutDir);
-        ScmResult result = HgUtils.execute(consumer, getLogger(), checkoutDir, inventory_cmd);
+        HgCheckOutConsumer consumer = new HgCheckOutConsumer( getLogger(), checkoutDir );
+        ScmResult result = HgUtils.execute( consumer, getLogger(), checkoutDir, inventory_cmd );
 
-        return new CheckOutScmResult(consumer.getCheckedOutFiles(), result);    }
+        return new CheckOutScmResult( consumer.getCheckedOutFiles(), result );
+    }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffCommand.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffCommand.java Fri Apr 13 02:59:40 2007
@@ -35,24 +35,30 @@
     implements HgCommand
 {
 
-    protected DiffScmResult executeDiffCommand(ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion startRevision, ScmVersion endRevision) throws ScmException
+    protected DiffScmResult executeDiffCommand( ScmProviderRepository repo, ScmFileSet fileSet,
+                                                ScmVersion startRevision, ScmVersion endRevision )
+        throws ScmException
     {
         String[] diffCmd;
-        if (startRevision != null && !StringUtils.isEmpty(startRevision.getName())) {
+        if ( startRevision != null && !StringUtils.isEmpty( startRevision.getName() ) )
+        {
             String revArg = startRevision.getName();
-            if (endRevision != null && !StringUtils.isEmpty(endRevision.getName())) {
+            if ( endRevision != null && !StringUtils.isEmpty( endRevision.getName() ) )
+            {
                 revArg += ".." + endRevision;
             }
             diffCmd = new String[]{DIFF_CMD, REVISION_OPTION, revArg};
-        } else {
+        }
+        else
+        {
             diffCmd = new String[]{DIFF_CMD};
         }
 
-        diffCmd = HgUtils.expandCommandLine(diffCmd, fileSet);
-        HgDiffConsumer consumer = new HgDiffConsumer(getLogger(), fileSet.getBasedir());
+        diffCmd = HgUtils.expandCommandLine( diffCmd, fileSet );
+        HgDiffConsumer consumer = new HgDiffConsumer( getLogger(), fileSet.getBasedir() );
 
-        ScmResult result = HgUtils.execute(consumer, getLogger(), fileSet.getBasedir(), diffCmd);
+        ScmResult result = HgUtils.execute( consumer, getLogger(), fileSet.getBasedir(), diffCmd );
 
-        return new DiffScmResult(consumer.getChangedFiles(), consumer.getDifferences(), consumer.getPatch(), result);
+        return new DiffScmResult( consumer.getChangedFiles(), consumer.getDifferences(), consumer.getPatch(), result );
     }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffConsumer.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffConsumer.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffConsumer.java Fri Apr 13 02:59:40 2007
@@ -34,7 +34,7 @@
  * @author <a href="mailto:thurner.rupert@ymono.net">thurner rupert</a>
  */
 public class HgDiffConsumer
-        extends HgConsumer
+    extends HgConsumer
 {
 
     // private final static String MODIFIED_FILE_TOKEN = "=== modified file ";
@@ -126,8 +126,8 @@
             patch.append( line ).append( "\n" );
         }
         else if ( line.startsWith( ADDED_LINE_TOKEN ) || line.startsWith( REMOVED_LINE_TOKEN ) ||
-                  line.startsWith( UNCHANGED_LINE_TOKEN ) || line.startsWith( CHANGE_SEPARATOR_TOKEN ) ||
-                  line.equals( NO_NEWLINE_TOKEN ) )
+            line.startsWith( UNCHANGED_LINE_TOKEN ) || line.startsWith( CHANGE_SEPARATOR_TOKEN ) ||
+            line.equals( NO_NEWLINE_TOKEN ) )
         {
             // add to buffer
             currentDifference.append( line ).append( "\n" );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/remove/HgRemoveCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/remove/HgRemoveCommand.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/remove/HgRemoveCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/remove/HgRemoveCommand.java Fri Apr 13 02:59:40 2007
@@ -41,7 +41,7 @@
         throws ScmException
     {
 
-        String[] command = new String[] { REMOVE_CMD };
+        String[] command = new String[]{REMOVE_CMD};
         HgUtils.expandCommandLine( command, fileSet );
 
         File workingDir = fileSet.getBasedir();

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/status/HgStatusCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/status/HgStatusCommand.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/status/HgStatusCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/status/HgStatusCommand.java Fri Apr 13 02:59:40 2007
@@ -49,7 +49,7 @@
 
         File workingDir = fileSet.getBasedir();
         HgStatusConsumer consumer = new HgStatusConsumer( getLogger(), workingDir );
-        String[] statusCmd = new String[] { STATUS_CMD };
+        String[] statusCmd = new String[]{STATUS_CMD};
         ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, statusCmd );
 
         return new StatusScmResult( consumer.getStatus(), result );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/status/HgStatusConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/status/HgStatusConsumer.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/status/HgStatusConsumer.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/status/HgStatusConsumer.java Fri Apr 13 02:59:40 2007
@@ -47,7 +47,7 @@
 
     public void doConsume( ScmFileStatus status, String trimmedLine )
     {
-         //Only include real files (not directories)
+        //Only include real files (not directories)
         File tmpFile = new File( workingDir, trimmedLine );
         if ( !tmpFile.exists() )
         {

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/update/HgUpdateCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/update/HgUpdateCommand.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/update/HgUpdateCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/update/HgUpdateCommand.java Fri Apr 13 02:59:40 2007
@@ -19,7 +19,12 @@
  * under the License.
  */
 
-import org.apache.maven.scm.*;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.ScmVersion;
 import org.apache.maven.scm.command.changelog.ChangeLogCommand;
 import org.apache.maven.scm.command.update.AbstractUpdateCommand;
 import org.apache.maven.scm.command.update.UpdateScmResult;
@@ -46,14 +51,15 @@
     implements HgCommand
 {
 
-    protected UpdateScmResult executeUpdateCommand(ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion tag) throws ScmException
+    protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion tag )
+        throws ScmException
     {
         File workingDir = fileSet.getBasedir();
 
         // Update branch
-        String[] update_cmd = new String[] { HgCommand.PULL_CMD, REVISION_OPTION, tag != null && !StringUtils.isEmpty(tag.getName()) ? tag.getName() : "tip" };
-        ScmResult updateResult = HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), workingDir,
-                                                      update_cmd );
+        String[] update_cmd = new String[]{HgCommand.PULL_CMD, REVISION_OPTION,
+            tag != null && !StringUtils.isEmpty( tag.getName() ) ? tag.getName() : "tip"};
+        ScmResult updateResult = HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), workingDir, update_cmd );
 
         if ( !updateResult.isSuccess() )
         {
@@ -63,7 +69,7 @@
         // Find changes from last revision
         int currentRevision = HgUtils.getCurrentRevisionNumber( getLogger(), workingDir );
         int previousRevision = currentRevision - 1;
-        String[] diffCmd = new String[] { DIFF_CMD, REVISION_OPTION, "" + previousRevision };
+        String[] diffCmd = new String[]{DIFF_CMD, REVISION_OPTION, "" + previousRevision};
         HgDiffConsumer diffConsumer = new HgDiffConsumer( getLogger(), workingDir );
         ScmResult diffResult = HgUtils.execute( diffConsumer, getLogger(), workingDir, diffCmd );
 

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepository.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepository.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepository.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepository.java Fri Apr 13 02:59:40 2007
@@ -58,7 +58,8 @@
 
     public String getURI()
     {
-        return protocol + (needsAuthentication() ? addUser() + addPassword() + addAt() : "") +  addHost() + addPort() + addPath();
+        return protocol + ( needsAuthentication() ? addUser() + addPassword() + addAt() : "" ) + addHost() + addPort() +
+            addPath();
     }
 
     /**
@@ -92,15 +93,15 @@
 
         if ( msg != null )
         {
-            msg = "Something could be wrong about the repository URL: " + orgUrl + "\nReason: " + msg
-                + "\nCheck http://maven.apache.org/scm for usage and hints.";
+            msg = "Something could be wrong about the repository URL: " + orgUrl + "\nReason: " + msg +
+                "\nCheck http://maven.apache.org/scm for usage and hints.";
         }
         return msg;
     }
 
     private String getProtocol( String url )
     {
-    	// Assume we have a file unless we find a URL based syntax
+        // Assume we have a file unless we find a URL based syntax
         String prot = FILE;
         if ( url.startsWith( SFTP ) )
         {
@@ -150,9 +151,12 @@
                 if ( split.length == 2 )
                 {
                     url = url.substring( split[0].length() );
-                    try {
+                    try
+                    {
                         setPort( Integer.valueOf( split[0] ).intValue() );
-                    } catch (NumberFormatException e) {
+                    }
+                    catch ( NumberFormatException e )
+                    {
                         //Ignore - error will manifest itself later.
                     }
                 }
@@ -252,7 +256,7 @@
 
     public String toString()
     {
-        return "Hg Repository Interpreted from: " + orgUrl + ":\nProtocol: " + protocol + "\nHost: " + getHost()
-            + "\nPort: " + getPort() + "\nUsername: " + getUser() + "\nPassword: " + getPassword() + "\nPath: " + path;
+        return "Hg Repository Interpreted from: " + orgUrl + ":\nProtocol: " + protocol + "\nHost: " + getHost() +
+            "\nPort: " + getPort() + "\nUsername: " + getUser() + "\nPassword: " + getPassword() + "\nPath: " + path;
     }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/HgTestUtils.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/HgTestUtils.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/HgTestUtils.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/HgTestUtils.java Fri Apr 13 02:59:40 2007
@@ -39,11 +39,8 @@
     extends PlexusTestCase
 {
 
-    public static final String[] filesInTestBranch = new String[] {
-        "pom.xml",
-        "readme.txt",
-        "src/main/java/Application.java",
-        "src/test/java/Test.java" };
+    public static final String[] filesInTestBranch =
+        new String[]{"pom.xml", "readme.txt", "src/main/java/Application.java", "src/test/java/Test.java"};
 
     public static final String TCK_FILE_CONSTANT = "/";
 
@@ -81,7 +78,7 @@
         }
 
         // Init repository
-        String[] init_cmd = new String[] { HgCommand.INIT_CMD };
+        String[] init_cmd = new String[]{HgCommand.INIT_CMD};
         HgUtils.execute( WORKING_DIR, init_cmd );
 
         // Create and add files to repository
@@ -105,24 +102,24 @@
         }
 
         //Add to repository
-        String[] add_cmd = new String[] { HgCommand.ADD_CMD };
+        String[] add_cmd = new String[]{HgCommand.ADD_CMD};
         ScmFileSet filesToAdd = new ScmFileSet( new File( "" ), (File[]) files.toArray( new File[0] ) );
         add_cmd = HgUtils.expandCommandLine( add_cmd, filesToAdd );
         ScmResult result = HgUtils.execute( WORKING_DIR, add_cmd );
         if ( !result.isSuccess() )
         {
-            String message = "Provider message: " + result.getProviderMessage() + "\n" + "Output: "
-                + result.getCommandOutput();
+            String message =
+                "Provider message: " + result.getProviderMessage() + "\n" + "Output: " + result.getCommandOutput();
             throw new Exception( message );
         }
 
         // Commit the initial repository
-        String[] commit_cmd = new String[] { HgCommand.COMMIT_CMD, HgCommand.MESSAGE_OPTION, COMMIT_MESSAGE };
+        String[] commit_cmd = new String[]{HgCommand.COMMIT_CMD, HgCommand.MESSAGE_OPTION, COMMIT_MESSAGE};
         result = HgUtils.execute( WORKING_DIR, commit_cmd );
         if ( !result.isSuccess() )
         {
-        	String message = "Provider message: " + result.getProviderMessage() + "\n" + "Output: "
-                + result.getCommandOutput();
+            String message =
+                "Provider message: " + result.getProviderMessage() + "\n" + "Output: " + result.getCommandOutput();
             throw new Exception( message );
         }
     }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffCommandTckTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffCommandTckTest.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffCommandTckTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffCommandTckTest.java Fri Apr 13 02:59:40 2007
@@ -19,12 +19,6 @@
  * under the License.
  */
 
-import java.io.File;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeSet;
-
 import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmTestCase;
@@ -35,78 +29,89 @@
 import org.apache.maven.scm.repository.ScmRepository;
 import org.apache.maven.scm.tck.command.diff.DiffCommandTckTest;
 
-public class HgDiffCommandTckTest extends DiffCommandTckTest {
-	public String getScmUrl() throws Exception {
-		return HgTestUtils.getScmUrl();
-	}
-
-	public void initRepo() throws Exception {
-		HgTestUtils.initRepo();
-	}
-
-	public void testDiffCommand() throws Exception {
-		ScmRepository repository = getScmRepository();
-
-		// ----------------------------------------------------------------------
-		// Change the files
-		// ----------------------------------------------------------------------
-
-		//
-		// readme.txt is changed (changed file in the root directory)
-		// project.xml is added (added file in the root directory)
-		// src/test/resources is untouched (a empty directory is left untouched)
-		// src/test/java is untouched (a non empty directory is left untouched)
-
-		// This following test has no meaning to mercurial as mercurial does not track
-		// empty directories, only the files contained within
-		// See: http://www.selenic.com/mercurial/wiki/index.cgi/FAQ
-		// src/test/java/org (a empty directory is added)
-
-		// src/main/java/org/Foo.java (a non empty directory is added)
-		//
-
-		// /readme.txt
-		ScmTestCase.makeFile(getWorkingCopy(), "/readme.txt",
-				"changed readme.txt");
-
-		// /project.xml
-		ScmTestCase.makeFile(getWorkingCopy(), "/project.xml",
-				"changed project.xml");
+import java.io.File;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeSet;
+
+public class HgDiffCommandTckTest
+    extends DiffCommandTckTest
+{
+    public String getScmUrl()
+        throws Exception
+    {
+        return HgTestUtils.getScmUrl();
+    }
+
+    public void initRepo()
+        throws Exception
+    {
+        HgTestUtils.initRepo();
+    }
+
+    public void testDiffCommand()
+        throws Exception
+    {
+        ScmRepository repository = getScmRepository();
+
+        // ----------------------------------------------------------------------
+        // Change the files
+        // ----------------------------------------------------------------------
+
+        //
+        // readme.txt is changed (changed file in the root directory)
+        // project.xml is added (added file in the root directory)
+        // src/test/resources is untouched (a empty directory is left untouched)
+        // src/test/java is untouched (a non empty directory is left untouched)
+
+        // This following test has no meaning to mercurial as mercurial does not track
+        // empty directories, only the files contained within
+        // See: http://www.selenic.com/mercurial/wiki/index.cgi/FAQ
+        // src/test/java/org (a empty directory is added)
+
+        // src/main/java/org/Foo.java (a non empty directory is added)
+        //
+
+        // /readme.txt
+        ScmTestCase.makeFile( getWorkingCopy(), "/readme.txt", "changed readme.txt" );
+
+        // /project.xml
+        ScmTestCase.makeFile( getWorkingCopy(), "/project.xml", "changed project.xml" );
 
-		addToWorkingTree(getWorkingCopy(), new File("project.xml"), repository);
+        addToWorkingTree( getWorkingCopy(), new File( "project.xml" ), repository );
 
-		// /src/test/java/org
+        // /src/test/java/org
 //		ScmTestCase.makeDirectory(getWorkingCopy(), "/src/test/java/org");
 //
 //		addToWorkingTree(getWorkingCopy(), new File("src/test/java/org"),
 //				repository);
 
-		// /src/main/java/org/Foo.java
-		ScmTestCase.makeFile(getWorkingCopy(), "/src/main/java/org/Foo.java");
+        // /src/main/java/org/Foo.java
+        ScmTestCase.makeFile( getWorkingCopy(), "/src/main/java/org/Foo.java" );
 
 //		addToWorkingTree(getWorkingCopy(), new File("src/main/java/org"),
 //				repository);
 
-		// src/main/java/org/Foo.java
-		addToWorkingTree(getWorkingCopy(), new File(
-				"src/main/java/org/Foo.java"), repository);
-
-		// ----------------------------------------------------------------------
-		// Diff the project
-		// ----------------------------------------------------------------------
-
-		ScmProvider provider = getScmManager().getProviderByUrl(getScmUrl());
-		ScmFileSet fileSet = new ScmFileSet(getWorkingCopy());
-		DiffScmResult result = provider.diff(repository, fileSet, (ScmVersion)null, null);
+        // src/main/java/org/Foo.java
+        addToWorkingTree( getWorkingCopy(), new File( "src/main/java/org/Foo.java" ), repository );
+
+        // ----------------------------------------------------------------------
+        // Diff the project
+        // ----------------------------------------------------------------------
+
+        ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() );
+        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy() );
+        DiffScmResult result = provider.diff( repository, fileSet, (ScmVersion) null, null );
 
 //		todo: check asserts
 //		assertNotNull("The command returned a null result.", result);
 
 //      assertResultIsSuccess(result);
 
-		List changedFiles = result.getChangedFiles();
+        List changedFiles = result.getChangedFiles();
 
-		Map differences = result.getDifferences();
+        Map differences = result.getDifferences();
 
 //		assertEquals("Expected 3 files in the changed files list "
 //				+ changedFiles, 3, changedFiles.size());
@@ -118,41 +123,42 @@
 //		 Assert the files in the changed files list
 //		 ----------------------------------------------------------------------
 
-		Iterator files = new TreeSet(changedFiles).iterator();
+        Iterator files = new TreeSet( changedFiles ).iterator();
 
 //		Check Foo.java
-		ScmFile file = (ScmFile) files.next();
+        ScmFile file = (ScmFile) files.next();
 
 //		assertPath("/src/main/java/org/Foo.java", file.getPath());
 
 //		assertTrue(file.getStatus().isDiff());
 
-		String postRangeStr = "+/src/main/java/org/Foo.java\n\\ No newline at end of file\n";
-		String actualStr = differences.get(file.getPath()).toString();
+        String postRangeStr = "+/src/main/java/org/Foo.java\n\\ No newline at end of file\n";
+        String actualStr = differences.get( file.getPath() ).toString();
 //		assertTrue(actualStr.endsWith(postRangeStr));
 
 //		Check readme.txt
-		file = (ScmFile) files.next();
+        file = (ScmFile) files.next();
 
 //		assertPath("/readme.txt", file.getPath());
 
 //		assertTrue(file.getStatus().isDiff());
 
-		postRangeStr = "-/readme.txt\n\\ No newline at end of file\n+changed readme.txt\n\\ No newline at end of file\n";
-		actualStr = differences.get(file.getPath()).toString();
+        postRangeStr =
+            "-/readme.txt\n\\ No newline at end of file\n+changed readme.txt\n\\ No newline at end of file\n";
+        actualStr = differences.get( file.getPath() ).toString();
 //		assertTrue(actualStr.endsWith(postRangeStr));
 
 //		Check project.xml
-		file = (ScmFile) files.next();
+        file = (ScmFile) files.next();
 
 //		assertPath("/project.xml", file.getPath());
 
-		postRangeStr = "+changed project.xml\n\\ No newline at end of file\n";
-		actualStr = differences.get(file.getPath()).toString();
+        postRangeStr = "+changed project.xml\n\\ No newline at end of file\n";
+        actualStr = differences.get( file.getPath() ).toString();
 //		assertTrue(actualStr.endsWith(postRangeStr));
 
 //		assertTrue(file.getStatus().isDiff());
-		assertTrue(true);
-	}
+        assertTrue( true );
+    }
 
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepositoryTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepositoryTest.java?view=diff&rev=528416&r1=528415&r2=528416
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepositoryTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepositoryTest.java Fri Apr 13 02:59:40 2007
@@ -59,7 +59,7 @@
     public void testSSHRepo()
     {
         //todo: check assert
-    	//1. Test with relativ path
+        //1. Test with relativ path
         String url = "ssh://username:password@myhost.com/~/dev/maven";
         HgScmProviderRepository repo = new HgScmProviderRepository( url );
         assertEquals( url, repo.getURI() );
@@ -81,7 +81,7 @@
     public void testHTTPRepo()
     {
         //todo: check assert
-    	//1. Test with relativ path
+        //1. Test with relativ path
         String url = "http://www.myhost.com/~username/dev/maven";
         HgScmProviderRepository repo = new HgScmProviderRepository( url );
         //assertEquals( url, repo.getURI() );
@@ -94,14 +94,14 @@
         //assertNull( repo.validateURI() );
 
         //3. Test with unessesary authentication information
-        repo.setPassword("Password");
-        repo.setUser("User");
-        repo.setPassphrase("Passphrase");
+        repo.setPassword( "Password" );
+        repo.setUser( "User" );
+        repo.setPassphrase( "Passphrase" );
         assertEquals( "http://www.myhost.com/dev/maven", repo.getURI() );
         //assertNull( repo.validateURI() );
-        repo.setPort(81);
+        repo.setPort( 81 );
         //assertEquals( "http://www.myhost.com:81/dev/maven", repo.getURI() );
         //assertNull( repo.validateURI() );
-        assertTrue(true);
+        assertTrue( true );
     }
 }



Mime
View raw message