maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r345897 [1/2] - in /maven/scm/trunk: maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/ maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/ maven-scm-api/src/main/java/org/apache/maven/scm/provider/ maven-scm-provid...
Date Mon, 21 Nov 2005 12:42:26 GMT
Author: evenisse
Date: Mon Nov 21 04:41:44 2005
New Revision: 345897

URL: http://svn.apache.org/viewcvs?rev=345897&view=rev
Log:
PR: SCM-77
Submitted by: Wim Deblauwe

Add Support for Clearcase.

Added:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/AbstractEditCommand.java   (with props)
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/EditScmResult.java   (with props)
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/AbstractUnEditCommand.java   (with props)
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/UnEditScmResult.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/unedit/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/unedit/ClearCaseUnEditCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/unedit/ClearCaseUnEditConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/add/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddConsumerTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/checkin/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInConsumerTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckinCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/edit/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditConsumerTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/remove/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveConsumerTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/status/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusConsumerTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/tag/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagConsumerTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/unedit/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/unedit/ClearCaseUnEditCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/unedit/ClearCaseUnEditConsumerTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/add/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/add/add.txt   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/checkin/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/checkin/checkin.txt   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/edit/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/edit/edit.txt   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/remove/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/remove/remove.txt   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/status/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/status/status.txt   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/tag/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/tag/tag.txt   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/unedit/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/unedit/unedit.txt   (with props)
Modified:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/ClearCaseScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommandTest.java

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/AbstractEditCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/AbstractEditCommand.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/AbstractEditCommand.java (added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/AbstractEditCommand.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,19 @@
+package org.apache.maven.scm.command.edit;
+
+import org.apache.maven.scm.command.AbstractCommand;
+import org.apache.maven.scm.*;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+
+/**
+ * 
+ */
+public abstract class AbstractEditCommand extends AbstractCommand
+{
+    public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        return executeEditCommand( repository, fileSet );
+    }
+
+    protected abstract ScmResult executeEditCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException;
+}

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/AbstractEditCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/AbstractEditCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/EditScmResult.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/EditScmResult.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/EditScmResult.java (added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/EditScmResult.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,31 @@
+package org.apache.maven.scm.command.edit;
+
+import org.apache.maven.scm.ScmResult;
+
+import java.util.List;
+
+/**
+ * 
+ */
+public class EditScmResult extends ScmResult
+{
+    private List editFiles;
+
+    public EditScmResult( String commandLine, String providerMessage, String commandOutput, boolean success )
+    {
+        super( commandLine, providerMessage, commandOutput, success );
+    }
+
+    public EditScmResult( String commandLine, List editFiles )
+    {
+        super( commandLine, null, null, true );
+
+        this.editFiles = editFiles;
+    }
+
+    public List getEditFiles()
+    {
+        return editFiles;
+    }
+
+}

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/EditScmResult.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/EditScmResult.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/AbstractUnEditCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/AbstractUnEditCommand.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/AbstractUnEditCommand.java (added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/AbstractUnEditCommand.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,19 @@
+package org.apache.maven.scm.command.unedit;
+
+import org.apache.maven.scm.command.AbstractCommand;
+import org.apache.maven.scm.*;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+
+/**
+ * 
+ */
+public abstract class AbstractUnEditCommand extends AbstractCommand
+{
+    public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        return executeUnEditCommand( repository, fileSet );
+    }
+
+    protected abstract ScmResult executeUnEditCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException;
+}

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/AbstractUnEditCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/AbstractUnEditCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/UnEditScmResult.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/UnEditScmResult.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/UnEditScmResult.java (added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/UnEditScmResult.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,31 @@
+package org.apache.maven.scm.command.unedit;
+
+import org.apache.maven.scm.ScmResult;
+
+import java.util.List;
+
+/**
+ * 
+ */
+public class UnEditScmResult extends ScmResult
+{
+    private List unEditFiles;
+
+    public UnEditScmResult( String commandLine, String providerMessage, String commandOutput, boolean success )
+    {
+        super( commandLine, providerMessage, commandOutput, success );
+    }
+
+    public UnEditScmResult( String commandLine, List unEditFiles )
+    {
+        super( commandLine, null, null, true );
+
+        this.unEditFiles = unEditFiles;
+    }
+
+    public List getUnEditFiles()
+    {
+        return unEditFiles;
+    }
+    
+}

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/UnEditScmResult.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/UnEditScmResult.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java?rev=345897&r1=345896&r2=345897&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java Mon Nov 21 04:41:44 2005
@@ -16,11 +16,7 @@
  * limitations under the License.
  */
 
-import org.apache.maven.scm.CommandParameter;
-import org.apache.maven.scm.CommandParameters;
-import org.apache.maven.scm.NoSuchCommandScmException;
-import org.apache.maven.scm.ScmException;
-import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.*;
 import org.apache.maven.scm.command.add.AddScmResult;
 import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
 import org.apache.maven.scm.command.checkin.CheckInScmResult;
@@ -30,6 +26,8 @@
 import org.apache.maven.scm.command.status.StatusScmResult;
 import org.apache.maven.scm.command.tag.TagScmResult;
 import org.apache.maven.scm.command.update.UpdateScmResult;
+import org.apache.maven.scm.command.edit.EditScmResult;
+import org.apache.maven.scm.command.unedit.UnEditScmResult;
 import org.apache.maven.scm.log.ScmLogDispatcher;
 import org.apache.maven.scm.log.ScmLogger;
 import org.apache.maven.scm.login.LoginScmResult;
@@ -316,7 +314,35 @@
         throw new NoSuchCommandScmException( "update" );
     }
 
-    // ----------------------------------------------------------------------
+	public EditScmResult edit( ScmRepository repository, ScmFileSet fileSet ) throws ScmException
+	{
+		login( repository, fileSet );
+
+		CommandParameters parameters = new CommandParameters();
+
+		return edit( repository, fileSet, parameters );
+	}
+
+	protected EditScmResult edit( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException
+	{
+		return new EditScmResult( "", null, null, true );
+	}
+
+	public UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet ) throws ScmException
+	{
+		login( repository, fileSet );
+
+		CommandParameters parameters = new CommandParameters();
+
+		return unedit( repository, fileSet, parameters );
+	}
+
+	protected UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException
+	{
+		return new UnEditScmResult( "", null, null, true );
+	}
+
+	// ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
 

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java?rev=345897&r1=345896&r2=345897&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java Mon Nov 21 04:41:44 2005
@@ -23,9 +23,11 @@
 import org.apache.maven.scm.command.checkin.CheckInScmResult;
 import org.apache.maven.scm.command.checkout.CheckOutScmResult;
 import org.apache.maven.scm.command.diff.DiffScmResult;
+import org.apache.maven.scm.command.edit.EditScmResult;
 import org.apache.maven.scm.command.remove.RemoveScmResult;
 import org.apache.maven.scm.command.status.StatusScmResult;
 import org.apache.maven.scm.command.tag.TagScmResult;
+import org.apache.maven.scm.command.unedit.UnEditScmResult;
 import org.apache.maven.scm.command.update.UpdateScmResult;
 import org.apache.maven.scm.log.ScmLogger;
 import org.apache.maven.scm.repository.ScmRepository;
@@ -176,4 +178,29 @@
      */
     UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate )
         throws ScmException;
+
+    /**
+     * Make a file editable. This is used in source control systems where you look at read-only files
+     * and you need to make them not read-only anymore before you can edit them. This can also mean
+     * that no other user in the system can make the file not read-only anymore.
+     *
+     * @param repository the source control system
+     * @param fileSet the files to make editable
+     * @return
+     * @throws ScmException
+     */
+    EditScmResult edit( ScmRepository repository, ScmFileSet fileSet )
+          throws ScmException;
+
+    /**
+     * Make a file no longer editable. This is the conterpart of {@link #edit(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet)}.
+     * It makes the file read-only again.
+     *
+     * @param repository the source control system
+     * @param fileSet the files to make uneditable
+     * @return
+     * @throws ScmException
+     */
+    UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet )
+      throws ScmException;
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/ClearCaseScmProvider.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/ClearCaseScmProvider.java?rev=345897&r1=345896&r2=345897&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/ClearCaseScmProvider.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/ClearCaseScmProvider.java Mon Nov 21 04:41:44 2005
@@ -21,10 +21,18 @@
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
 import org.apache.maven.scm.command.checkout.CheckOutScmResult;
+import org.apache.maven.scm.command.checkin.CheckInScmResult;
+import org.apache.maven.scm.command.tag.TagScmResult;
+import org.apache.maven.scm.command.status.StatusScmResult;
+import org.apache.maven.scm.command.edit.EditScmResult;
 import org.apache.maven.scm.provider.AbstractScmProvider;
 import org.apache.maven.scm.provider.ScmProviderRepository;
 import org.apache.maven.scm.provider.clearcase.command.changelog.ClearCaseChangeLogCommand;
 import org.apache.maven.scm.provider.clearcase.command.checkout.ClearCaseCheckOutCommand;
+import org.apache.maven.scm.provider.clearcase.command.checkin.ClearCaseCheckInCommand;
+import org.apache.maven.scm.provider.clearcase.command.tag.ClearCaseTagCommand;
+import org.apache.maven.scm.provider.clearcase.command.status.ClearCaseStatusCommand;
+import org.apache.maven.scm.provider.clearcase.command.edit.ClearCaseEditCommand;
 import org.apache.maven.scm.provider.clearcase.repository.ClearCaseScmProviderRepository;
 import org.apache.maven.scm.repository.ScmRepository;
 import org.apache.maven.scm.repository.ScmRepositoryException;
@@ -72,7 +80,20 @@
         return (ChangeLogScmResult) command.execute( repository.getProviderRepository(), fileSet, parameters );
     }
 
-    /**
+	/**
+	 * @see org.apache.maven.scm.provider.AbstractScmProvider#checkin(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.CommandParameters)
+	 */
+	public CheckInScmResult checkin( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+		throws ScmException
+	{
+		ClearCaseCheckInCommand command = new ClearCaseCheckInCommand();
+
+		command.setLogger( getLogger() );
+
+		return (CheckInScmResult) command.execute( repository.getProviderRepository(), fileSet, parameters );
+	}
+
+	/**
      * @see org.apache.maven.scm.provider.AbstractScmProvider#checkout(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.CommandParameters)
      */
     public CheckOutScmResult checkout( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters )
@@ -84,4 +105,37 @@
 
         return (CheckOutScmResult) command.execute( repository.getProviderRepository(), fileSet, parameters );
     }
+
+	/**
+	 * @see org.apache.maven.scm.provider.AbstractScmProvider#tag(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.CommandParameters)
+	 */
+	public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+		throws ScmException
+	{
+		ClearCaseTagCommand command = new ClearCaseTagCommand();
+
+		command.setLogger( getLogger() );
+
+		return (TagScmResult) command.execute( repository.getProviderRepository(), fileSet, parameters );
+	}
+
+	protected StatusScmResult status( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException
+	{
+		getLogger().info( "creating status command..." );
+		ClearCaseStatusCommand command = new ClearCaseStatusCommand();
+
+		command.setLogger( getLogger() );
+
+		getLogger().info( "executing status command..." );
+		return (StatusScmResult)command.execute( repository.getProviderRepository(), fileSet, parameters );
+	}
+
+	protected EditScmResult edit( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException
+	{
+		ClearCaseEditCommand command = new ClearCaseEditCommand();
+
+		command.setLogger( getLogger() );
+
+		return (EditScmResult)command.execute( repository.getProviderRepository(), fileSet, parameters );
+	}
 }

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddCommand.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddCommand.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddCommand.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,115 @@
+package org.apache.maven.scm.provider.clearcase.command.add;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+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.AbstractAddCommand;
+import org.apache.maven.scm.command.status.StatusScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand;
+import org.apache.maven.scm.provider.clearcase.command.edit.ClearCaseEditCommand;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+import java.io.File;
+
+/**
+ * @author <a href="mailto:wim.deblauwe@gmail.com">Wim Deblauwe</a>
+ */
+public class ClearCaseAddCommand
+        extends AbstractAddCommand
+        implements ClearCaseCommand
+{
+    protected ScmResult executeAddCommand( ScmProviderRepository scmProviderRepository, ScmFileSet scmFileSet, String string, boolean b ) throws ScmException
+    {
+        getLogger().info( "executing add command..." );
+        Commandline cl = createCommandLine( scmFileSet );
+
+        ClearCaseAddConsumer consumer = new ClearCaseAddConsumer( getLogger() );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+
+        int exitCode;
+
+        try
+        {
+            // First we need to 'check out' the current directory
+            Commandline checkoutCurrentDirCommandLine = ClearCaseEditCommand.createCheckoutCurrentDirCommandLine( scmFileSet );
+            exitCode = CommandLineUtils.executeCommandLine( checkoutCurrentDirCommandLine, new CommandLineUtils.StringStreamConsumer(), stderr );
+
+            if (exitCode == 0)
+            {
+                // Then we add the file
+                exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr );
+
+                if (exitCode == 0)
+                {
+                    // Then we check in the current directory again.
+                    Commandline checkinCurrentDirCommandLine = ClearCaseEditCommand.createCheckinCurrentDirCommandLine( scmFileSet );
+                    exitCode = CommandLineUtils.executeCommandLine( checkinCurrentDirCommandLine, new CommandLineUtils.StringStreamConsumer(), stderr );
+                }
+            }
+        }
+        catch (CommandLineException ex)
+        {
+            throw new ScmException( "Error while executing clearcase command.", ex );
+        }
+
+        if (exitCode != 0)
+        {
+            return new StatusScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false );
+        }
+
+        return new StatusScmResult( cl.toString(), consumer.getAddedFiles() );
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public static Commandline createCommandLine( ScmFileSet scmFileSet )
+    {
+        Commandline command = new Commandline();
+
+        File workingDirectory = scmFileSet.getBasedir();
+
+        command.setWorkingDirectory( workingDirectory.getAbsolutePath() );
+
+        command.setExecutable( "cleartool" );
+
+        command.createArgument().setValue( "mkelem" );
+
+        command.createArgument().setValue( "-c" );
+
+        command.createArgument().setValue( "new file" );
+
+        command.createArgument().setValue( "-nco" );
+
+        File[] files = scmFileSet.getFiles();
+        for (int i = 0; i < files.length; i++)
+        {
+            File file = files[i];
+            command.createArgument().setValue( file.getName() );
+        }
+
+        return command;
+    }
+
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddConsumer.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddConsumer.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddConsumer.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddConsumer.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,66 @@
+package org.apache.maven.scm.provider.clearcase.command.add;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.log.ScmLogger;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:wim.deblauwe@gmail.com">Wim Deblauwe</a>
+ */
+public class ClearCaseAddConsumer
+        implements StreamConsumer
+{
+    private ScmLogger logger;
+
+    private List addedFiles = new ArrayList();
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public ClearCaseAddConsumer( ScmLogger logger )
+    {
+        this.logger = logger;
+    }
+
+    // ----------------------------------------------------------------------
+    // Stream Consumer Implementation
+    // ----------------------------------------------------------------------
+
+    public void consumeLine( String line )
+    {
+        logger.info( line );
+        int beginIndex = line.indexOf( '"' );
+        String fileName = line.substring( beginIndex + 1, line.indexOf( '"', beginIndex + 1 ) );
+        addedFiles.add( new ScmFile( fileName, ScmFileStatus.ADDED ) );
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public List getAddedFiles()
+    {
+        return addedFiles;
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddConsumer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddConsumer.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommand.java?rev=345897&r1=345896&r2=345897&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommand.java Mon Nov 21 04:41:44 2005
@@ -16,21 +16,20 @@
  * limitations under the License.
  */
 
-import java.io.File;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Locale;
-
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand;
 import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
 import org.apache.maven.scm.provider.ScmProviderRepository;
 import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand;
-
 import org.codehaus.plexus.util.cli.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
+
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInCommand.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInCommand.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInCommand.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,108 @@
+package org.apache.maven.scm.provider.clearcase.command.checkin;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.checkin.AbstractCheckInCommand;
+import org.apache.maven.scm.command.checkin.CheckInScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+import java.io.File;
+
+/**
+ * @author <a href="mailto:wim.deblauwe@gmail.com">Wim Deblauwe</a>
+ */
+public class ClearCaseCheckInCommand
+        extends AbstractCheckInCommand
+        implements ClearCaseCommand
+{
+    // ----------------------------------------------------------------------
+    // AbstractCheckOutCommand Implementation
+    // ----------------------------------------------------------------------
+
+    protected CheckInScmResult executeCheckInCommand( ScmProviderRepository scmProviderRepository,
+                                                      ScmFileSet fileSet,
+                                                      String message,
+                                                      String tag ) throws ScmException
+    {
+        Commandline cl = createCommandLine( fileSet, message );
+
+        ClearCaseCheckInConsumer consumer = new ClearCaseCheckInConsumer( getLogger() );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+
+        int exitCode;
+
+        try
+        {
+            exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr );
+        }
+        catch (CommandLineException ex)
+        {
+            throw new ScmException( "Error while executing clearcase command.", ex );
+        }
+
+        if (exitCode != 0)
+        {
+            return new CheckInScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false );
+        }
+
+        return new CheckInScmResult( cl.toString(), consumer.getCheckedInFiles() );
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public static Commandline createCommandLine( ScmFileSet scmFileSet, String message )
+    {
+        Commandline command = new Commandline();
+
+        File workingDirectory = scmFileSet.getBasedir();
+
+        command.setWorkingDirectory( workingDirectory.getAbsolutePath() );
+
+        command.setExecutable( "cleartool" );
+
+        command.createArgument().setValue( "ci" );
+
+        if (message != null)
+        {
+            command.createArgument().setValue( "-c" );
+            command.createArgument().setLine( "\"" + message + "\"" );
+        }
+        else
+        {
+            command.createArgument().setValue( "-nc" );
+        }
+
+        File[] files = scmFileSet.getFiles();
+        for (int i = 0; i < files.length; i++)
+        {
+            File file = files[i];
+            command.createArgument().setValue( file.getName() );
+        }
+
+
+        return command;
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInConsumer.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInConsumer.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInConsumer.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInConsumer.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,66 @@
+package org.apache.maven.scm.provider.clearcase.command.checkin;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.log.ScmLogger;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ */
+public class ClearCaseCheckInConsumer
+        implements StreamConsumer
+{
+    private ScmLogger logger;
+
+    private List checkedInFiles = new ArrayList();
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public ClearCaseCheckInConsumer( ScmLogger logger )
+    {
+        this.logger = logger;
+    }
+
+    // ----------------------------------------------------------------------
+    // Stream Consumer Implementation
+    // ----------------------------------------------------------------------
+
+    public void consumeLine( String line )
+    {
+        logger.info( line );
+        int beginIndex = line.indexOf( '"' );
+        String fileName = line.substring( beginIndex + 1, line.indexOf( '"', beginIndex + 1 ) );
+        checkedInFiles.add( new ScmFile( fileName, ScmFileStatus.CHECKED_IN ) );
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public List getCheckedInFiles()
+    {
+        return checkedInFiles;
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInConsumer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInConsumer.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java?rev=345897&r1=345896&r2=345897&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java Mon Nov 21 04:41:44 2005
@@ -16,19 +16,18 @@
  * limitations under the License.
  */
 
-import java.io.File;
-
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand;
 import org.apache.maven.scm.command.checkout.CheckOutScmResult;
 import org.apache.maven.scm.provider.ScmProviderRepository;
 import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand;
-
 import org.codehaus.plexus.util.cli.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 
+import java.io.File;
+
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
@@ -59,7 +58,7 @@
         }
         catch ( CommandLineException ex )
         {
-            throw new ScmException( "Error while executing cvs command.", ex );
+            throw new ScmException( "Error while executing clearcase command.", ex );
         }
 
         if ( exitCode != 0 )

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutConsumer.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutConsumer.java?rev=345897&r1=345896&r2=345897&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutConsumer.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutConsumer.java Mon Nov 21 04:41:44 2005
@@ -16,11 +16,11 @@
  * limitations under the License.
  */
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.maven.scm.log.ScmLogger;
 import org.codehaus.plexus.util.cli.StreamConsumer;
+
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditCommand.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditCommand.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditCommand.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,135 @@
+package org.apache.maven.scm.provider.clearcase.command.edit;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.command.edit.AbstractEditCommand;
+import org.apache.maven.scm.command.status.StatusScmResult;
+import org.apache.maven.scm.log.ScmLogger;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+import java.io.File;
+
+/**
+ * @author <a href="mailto:wim.deblauwe@gmail.com">Wim Deblauwe</a>
+ */
+public class ClearCaseEditCommand
+        extends AbstractEditCommand
+        implements ClearCaseCommand
+{
+    protected ScmResult executeEditCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException
+    {
+        getLogger().error( "executing edit command..." );
+        Commandline cl = createCommandLine( getLogger(), fileSet );
+
+        ClearCaseEditConsumer consumer = new ClearCaseEditConsumer( getLogger() );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+
+        int exitCode;
+
+        try
+        {
+            exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr );
+        }
+        catch (CommandLineException ex)
+        {
+            throw new ScmException( "Error while executing clearcase command.", ex );
+        }
+
+        if (exitCode != 0)
+        {
+            return new StatusScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false );
+        }
+
+        return new StatusScmResult( cl.toString(), consumer.getEditFiles() );
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public static Commandline createCommandLine( ScmLogger logger, ScmFileSet scmFileSet )
+    {
+        Commandline command = new Commandline();
+
+        File workingDirectory = scmFileSet.getBasedir();
+
+        command.setWorkingDirectory( workingDirectory.getAbsolutePath() );
+
+        command.setExecutable( "cleartool" );
+
+        command.createArgument().setValue( "co" );
+
+        command.createArgument().setValue( "-nc" );
+
+        File[] files = scmFileSet.getFiles();
+        for (int i = 0; i < files.length; i++)
+        {
+            File file = files[i];
+            logger.info( "Checking out file: " + file.getAbsolutePath() );
+            command.createArgument().setValue( file.getName() );
+        }
+
+        return command;
+    }
+
+    public static Commandline createCheckoutCurrentDirCommandLine( ScmFileSet scmFileSet )
+    {
+        Commandline command = new Commandline();
+
+        File workingDirectory = scmFileSet.getBasedir();
+
+        command.setWorkingDirectory( workingDirectory.getAbsolutePath() );
+
+        command.setExecutable( "cleartool" );
+
+        command.createArgument().setValue( "co" );
+
+        command.createArgument().setValue( "-nc" );
+
+        command.createArgument().setValue( "." );
+
+        return command;
+    }
+
+    public static Commandline createCheckinCurrentDirCommandLine( ScmFileSet scmFileSet )
+    {
+        Commandline command = new Commandline();
+
+        File workingDirectory = scmFileSet.getBasedir();
+
+        command.setWorkingDirectory( workingDirectory.getAbsolutePath() );
+
+        command.setExecutable( "cleartool" );
+
+        command.createArgument().setValue( "ci" );
+
+        command.createArgument().setValue( "-nc" );
+
+        command.createArgument().setValue( "." );
+
+        return command;
+    }
+
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditConsumer.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditConsumer.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditConsumer.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditConsumer.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,66 @@
+package org.apache.maven.scm.provider.clearcase.command.edit;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.log.ScmLogger;
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileStatus;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:wim.deblauwe@gmail.com">Wim Deblauwe</a>
+ */
+public class ClearCaseEditConsumer
+        implements StreamConsumer
+{
+    private ScmLogger logger;
+
+    private List editFiles = new ArrayList();
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public ClearCaseEditConsumer( ScmLogger logger )
+    {
+        this.logger = logger;
+    }
+
+    // ----------------------------------------------------------------------
+    // Stream Consumer Implementation
+    // ----------------------------------------------------------------------
+
+    public void consumeLine( String line )
+    {
+        logger.info( line );
+        int beginIndex = line.indexOf( '"' );
+        String fileName = line.substring( beginIndex + 1, line.indexOf( '"', beginIndex + 1 ) );
+        editFiles.add( new ScmFile( fileName, ScmFileStatus.UNKNOWN ) );
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public List getEditFiles()
+    {
+        return editFiles;
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditConsumer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditConsumer.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveCommand.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveCommand.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveCommand.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,111 @@
+package org.apache.maven.scm.provider.clearcase.command.remove;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.command.remove.AbstractRemoveCommand;
+import org.apache.maven.scm.command.status.StatusScmResult;
+import org.apache.maven.scm.log.ScmLogger;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand;
+import org.apache.maven.scm.provider.clearcase.command.edit.ClearCaseEditCommand;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+import java.io.File;
+
+/**
+ * @author <a href="mailto:wim.deblauwe@gmail.com">Wim Deblauwe</a>
+ */
+public class ClearCaseRemoveCommand
+        extends AbstractRemoveCommand
+        implements ClearCaseCommand
+{
+    protected ScmResult executeRemoveCommand( ScmProviderRepository scmProviderRepository, ScmFileSet scmFileSet, String string ) throws ScmException
+    {
+        getLogger().error( "executing status command..." );
+        Commandline cl = createCommandLine( getLogger(), scmFileSet );
+
+        ClearCaseRemoveConsumer consumer = new ClearCaseRemoveConsumer( getLogger() );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+
+        int exitCode;
+        try
+        {
+            // First we need to 'check out' the current directory
+            Commandline checkoutCurrentDirCommandLine = ClearCaseEditCommand.createCheckoutCurrentDirCommandLine( scmFileSet );
+            exitCode = CommandLineUtils.executeCommandLine( checkoutCurrentDirCommandLine, new CommandLineUtils.StringStreamConsumer(), stderr );
+
+            if (exitCode == 0)
+            {
+                // Then we add the file
+                exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr );
+
+                if (exitCode == 0)
+                {
+                    // Then we check in the current directory again.
+                    Commandline checkinCurrentDirCommandLine = ClearCaseEditCommand.createCheckinCurrentDirCommandLine( scmFileSet );
+                    exitCode = CommandLineUtils.executeCommandLine( checkinCurrentDirCommandLine, new CommandLineUtils.StringStreamConsumer(), stderr );
+                }
+            }
+        }
+        catch (CommandLineException ex)
+        {
+            throw new ScmException( "Error while executing clearcase command.", ex );
+        }
+
+        if (exitCode != 0)
+        {
+            return new StatusScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false );
+        }
+
+        return new StatusScmResult( cl.toString(), consumer.getRemovedFiles() );
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public static Commandline createCommandLine( ScmLogger logger, ScmFileSet scmFileSet )
+    {
+        Commandline command = new Commandline();
+
+        File workingDirectory = scmFileSet.getBasedir();
+
+        command.setWorkingDirectory( workingDirectory.getAbsolutePath() );
+
+        command.setExecutable( "cleartool" );
+
+        command.createArgument().setValue( "rmname" );
+
+        command.createArgument().setValue( "-nc" );
+
+        File[] files = scmFileSet.getFiles();
+        for (int i = 0; i < files.length; i++)
+        {
+            File file = files[i];
+            logger.info( "Deleting file: " + file.getAbsolutePath() );
+            command.createArgument().setValue( file.getName() );
+        }
+
+        return command;
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveConsumer.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveConsumer.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveConsumer.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveConsumer.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,66 @@
+package org.apache.maven.scm.provider.clearcase.command.remove;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.log.ScmLogger;
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileStatus;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:wim.deblauwe@gmail.com">Wim Deblauwe</a>
+ */
+public class ClearCaseRemoveConsumer
+        implements StreamConsumer
+{
+    private ScmLogger logger;
+
+    private List removedFiles = new ArrayList();
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public ClearCaseRemoveConsumer( ScmLogger logger )
+    {
+        this.logger = logger;
+    }
+
+    // ----------------------------------------------------------------------
+    // Stream Consumer Implementation
+    // ----------------------------------------------------------------------
+
+    public void consumeLine( String line )
+    {
+        logger.info( line );
+        int beginIndex = line.indexOf( '"' );
+        String fileName = line.substring( beginIndex + 1, line.indexOf( '"', beginIndex + 1 ) );
+        removedFiles.add( new ScmFile( fileName, ScmFileStatus.DELETED ) );        
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public List getRemovedFiles()
+    {
+        return removedFiles;
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveConsumer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveConsumer.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusCommand.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusCommand.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusCommand.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,89 @@
+package org.apache.maven.scm.provider.clearcase.command.status;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.status.AbstractStatusCommand;
+import org.apache.maven.scm.command.status.StatusScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+import java.io.File;
+
+/**
+ * @author <a href="mailto:wim.deblauwe@gmail.com">Wim Deblauwe</a>
+ * @version
+ */
+public class ClearCaseStatusCommand
+    extends AbstractStatusCommand
+    implements ClearCaseCommand
+{
+    protected StatusScmResult executeStatusCommand( ScmProviderRepository scmProviderRepository,
+                                                    ScmFileSet scmFileSet ) throws ScmException
+    {
+        getLogger().error( "executing status command..." );
+        Commandline cl = createCommandLine( scmFileSet );
+
+        ClearCaseStatusConsumer consumer = new ClearCaseStatusConsumer( getLogger(), scmFileSet.getBasedir() );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+
+        int exitCode;
+
+        try
+        {
+            exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr );
+        }
+        catch ( CommandLineException ex )
+        {
+            throw new ScmException( "Error while executing clearcase command.", ex );
+        }
+
+        if ( exitCode != 0 )
+        {
+            return new StatusScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false );
+        }
+
+        return new StatusScmResult( cl.toString(), consumer.getCheckedOutFiles() );
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public static Commandline createCommandLine( ScmFileSet scmFileSet )
+    {
+        Commandline command = new Commandline();
+
+        File workingDirectory = scmFileSet.getBasedir();
+
+        command.setWorkingDirectory( workingDirectory.getAbsolutePath() );
+
+        command.setExecutable( "cleartool" );
+
+        command.createArgument().setValue( "lscheckout" );
+        command.createArgument().setValue( "-r" );
+        command.createArgument().setValue( "-fmt" );
+        command.createArgument().setValue( "%n\\n");
+
+        return command;
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusConsumer.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusConsumer.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusConsumer.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusConsumer.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,68 @@
+package org.apache.maven.scm.provider.clearcase.command.status;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.log.ScmLogger;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.io.File;
+
+/**
+ * @author <a href="mailto:wim.deblauwe@gmail.com">Wim Deblauwe</a>
+ */
+public class ClearCaseStatusConsumer
+        implements StreamConsumer
+{
+    private ScmLogger logger;
+
+    private File workingDirectory;
+
+    private List checkedOutFiles = new ArrayList();
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public ClearCaseStatusConsumer( ScmLogger logger, File workingDirectory )
+    {
+        this.logger = logger;
+        this.workingDirectory = workingDirectory;
+    }
+
+    // ----------------------------------------------------------------------
+    // Stream Consumer Implementation
+    // ----------------------------------------------------------------------
+
+    public void consumeLine( String line )
+    {
+        logger.info( line );
+        checkedOutFiles.add( new ScmFile( workingDirectory.getAbsolutePath() + line.substring( 1 ), ScmFileStatus.CHECKED_OUT ) );
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public List getCheckedOutFiles()
+    {
+        return checkedOutFiles;
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusConsumer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusConsumer.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommand.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommand.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommand.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,122 @@
+package org.apache.maven.scm.provider.clearcase.command.tag;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.command.checkin.CheckInScmResult;
+import org.apache.maven.scm.command.tag.AbstractTagCommand;
+import org.apache.maven.scm.command.tag.TagScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand;
+import org.apache.maven.scm.provider.clearcase.command.checkin.ClearCaseCheckInConsumer;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+import java.io.File;
+
+/**
+ * @author <a href="mailto:wim.deblauwe@gmail.com">Wim Deblauwe</a>
+ * @version
+ */
+public class ClearCaseTagCommand
+    extends AbstractTagCommand
+    implements ClearCaseCommand
+{
+
+    protected ScmResult executeTagCommand( ScmProviderRepository scmProviderRepository,
+                                           ScmFileSet fileSet,
+                                           String tag ) throws ScmException
+    {
+        Commandline cl = createCommandLine( fileSet, tag );
+
+        ClearCaseCheckInConsumer consumer = new ClearCaseCheckInConsumer( getLogger() );
+
+        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+
+        int exitCode;
+
+        try
+        {
+            Commandline newLabelCommandLine = createNewLabelCommandLine( fileSet, tag );
+            exitCode = CommandLineUtils.executeCommandLine( newLabelCommandLine, new CommandLineUtils.StringStreamConsumer(), stderr );
+
+            if( exitCode == 0 )
+            {
+                exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr );
+            }
+        }
+        catch ( CommandLineException ex )
+        {
+            throw new ScmException( "Error while executing clearcase command.", ex );
+        }
+
+        if ( exitCode != 0 )
+        {
+            return new CheckInScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false );
+        }
+
+        return new TagScmResult( cl.toString(), consumer.getCheckedInFiles() );
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public static Commandline createCommandLine( ScmFileSet scmFileSet, String tag )
+    {
+        Commandline command = new Commandline();
+
+        File workingDirectory = scmFileSet.getBasedir();
+
+        command.setWorkingDirectory( workingDirectory.getAbsolutePath() );
+
+        command.setExecutable( "cleartool" );
+
+        command.createArgument().setValue( "mklabel" );
+        command.createArgument().setValue( tag );
+
+        File[] files = scmFileSet.getFiles();
+        for (int i = 0; i < files.length; i++)
+        {
+            File file = files[i];
+            command.createArgument().setValue( file.getName() );    
+        }
+
+
+        return command;
+    }
+
+    private static Commandline createNewLabelCommandLine( ScmFileSet scmFileSet, String tag )
+    {
+        Commandline command = new Commandline();
+
+        File workingDirectory = scmFileSet.getBasedir();
+
+        command.setWorkingDirectory( workingDirectory.getAbsolutePath() );
+
+        command.setExecutable( "cleartool" );
+
+        command.createArgument().setValue( "mklbtype" );
+        command.createArgument().setValue( "-nc" );
+        command.createArgument().setValue( tag );
+
+        return command;
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagConsumer.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagConsumer.java?rev=345897&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagConsumer.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagConsumer.java Mon Nov 21 04:41:44 2005
@@ -0,0 +1,69 @@
+package org.apache.maven.scm.provider.clearcase.command.tag;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.log.ScmLogger;
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileStatus;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version 
+ */
+public class ClearCaseTagConsumer
+    implements StreamConsumer
+{
+    private ScmLogger logger;
+
+    private List taggedFiles = new ArrayList();
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public ClearCaseTagConsumer( ScmLogger logger )
+    {
+        this.logger = logger;
+    }
+
+    // ----------------------------------------------------------------------
+    // Stream Consumer Implementation
+    // ----------------------------------------------------------------------
+
+    public void consumeLine( String line )
+    {
+        logger.info( line );
+        int beginIndexTag = line.indexOf( '"' );
+        int endIndexTag = line.indexOf( '"', beginIndexTag + 1 );
+        int beginIndex = line.indexOf( '"', endIndexTag + 1 );
+        String fileName = line.substring( beginIndex + 1, line.indexOf( '"', beginIndex + 1 ) );
+        taggedFiles.add( new ScmFile( fileName, ScmFileStatus.TAGGED ) );
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public List getTaggedFiles()
+    {
+        return taggedFiles;
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagConsumer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagConsumer.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message