maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ken...@apache.org
Subject svn commit: r495794 - in /maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src: main/java/org/apache/maven/scm/provider/cvslib/ main/java/org/apache/maven/scm/provider/cvslib/command/list/ test/java/org/apache/...
Date Sat, 13 Jan 2007 00:22:04 GMT
Author: kenney
Date: Fri Jan 12 16:22:01 2007
New Revision: 495794

URL: http://svn.apache.org/viewvc?view=rev&rev=495794
Log:
add list command implementation

Added:
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/AbstractCvsListCommand.java
  (with props)
Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/provider/cvslib/repository/TestCvsScmProvider.java

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java?view=diff&rev=495794&r1=495793&r2=495794
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java
Fri Jan 12 16:22:01 2007
@@ -29,6 +29,7 @@
 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.list.ListScmResult;
 import org.apache.maven.scm.command.login.LoginScmResult;
 import org.apache.maven.scm.command.remove.RemoveScmResult;
 import org.apache.maven.scm.command.status.StatusScmResult;
@@ -493,6 +494,8 @@
 
     protected abstract Command getDiffCommand();
 
+    protected abstract Command getListCommand();
+
     protected abstract Command getLoginCommand();
 
     protected abstract Command getRemoveCommand();
@@ -591,6 +594,15 @@
         throws ScmException
     {
         return (UpdateScmResult) executeCommand( getUpdateCommand(), repository, fileSet,
parameters );
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.AbstractScmProvider#list(org.apache.maven.scm.repository.ScmRepository,
org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.CommandParameters)
+     */
+    protected ListScmResult list( ScmRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
+        throws ScmException
+    {
+        return (ListScmResult) executeCommand( getListCommand(), repository, fileSet, parameters
);
     }
 
     /**

Added: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/AbstractCvsListCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/AbstractCvsListCommand.java?view=auto&rev=495794
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/AbstractCvsListCommand.java
(added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/AbstractCvsListCommand.java
Fri Jan 12 16:22:01 2007
@@ -0,0 +1,64 @@
+package org.apache.maven.scm.provider.cvslib.command.list;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.list.AbstractListCommand;
+import org.apache.maven.scm.command.list.ListScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.cvslib.command.CvsCommand;
+import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils;
+import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository;
+import org.codehaus.plexus.util.cli.Commandline;
+
+/**
+ *
+ * @author <a href="mailto:kenney@apache.org">Kenney Westerhof</a>
+ *
+ */
+public abstract class AbstractCvsListCommand
+    extends AbstractListCommand
+    implements CvsCommand
+{
+    protected ListScmResult executeListCommand( ScmProviderRepository repo, ScmFileSet fileSet,
+                                                boolean recursive )
+        throws ScmException
+    {
+        CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
+
+        Commandline cl = CvsCommandUtils.getBaseCommand( "rls", repository, fileSet, "-n"
);
+
+        cl.createArgument().setValue( "-d" );
+
+        if ( recursive  )
+        {
+            cl.createArgument().setValue( "-R" );
+        }
+
+        getLogger().info( "Executing: " + cl );
+        getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath()
);
+
+        return executeCvsCommand( cl );
+    }
+
+    protected abstract ListScmResult executeCvsCommand( Commandline cl )
+        throws ScmException;
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/AbstractCvsListCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/AbstractCvsListCommand.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/provider/cvslib/repository/TestCvsScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/provider/cvslib/repository/TestCvsScmProvider.java?view=diff&rev=495794&r1=495793&r2=495794
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/provider/cvslib/repository/TestCvsScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/provider/cvslib/repository/TestCvsScmProvider.java
Fri Jan 12 16:22:01 2007
@@ -54,6 +54,11 @@
         return null;
     }
 
+    protected Command getListCommand()
+    {
+        return null;
+    }
+
     protected Command getLoginCommand()
     {
         return null;



Mime
View raw message