maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r374628 - in /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src: main/java/org/apache/maven/scm/provider/cvslib/command/ main/java/org/apache/maven/scm/provider/cvslib/command/add/ main/java/org/apache/maven/scm/provider/cvslib...
Date Fri, 03 Feb 2006 10:00:19 GMT
Author: evenisse
Date: Fri Feb  3 02:00:04 2006
New Revision: 374628

URL: http://svn.apache.org/viewcvs?rev=374628&view=rev
Log:
Remove duplicated code. The base cvs command is now in CvsCommandUtils.

Added:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/CvsCommandUtils.java
  (with props)
Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/add/CvsAddCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/remove/CvsRemoveCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommandTest.java

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/CvsCommandUtils.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/CvsCommandUtils.java?rev=374628&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/CvsCommandUtils.java
(added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/CvsCommandUtils.java
Fri Feb  3 02:00:04 2006
@@ -0,0 +1,66 @@
+package org.apache.maven.scm.provider.cvslib.command;
+
+/*
+ * Copyright 2001-2006 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.ScmFileSet;
+import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository;
+import org.codehaus.plexus.util.cli.Commandline;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class CvsCommandUtils
+{
+    private CvsCommandUtils()
+    {
+    }
+
+    public static Commandline getBaseCommand( String commandName, CvsScmProviderRepository
repo, ScmFileSet fileSet )
+    {
+        return getBaseCommand( commandName, repo, fileSet, null );
+    }
+
+    public static Commandline getBaseCommand( String commandName, CvsScmProviderRepository
repo, ScmFileSet fileSet,
+                                              String options )
+    {
+        Commandline cl = new Commandline();
+
+        cl.setExecutable( "cvs" );
+
+        cl.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() );
+
+        if ( !System.getProperty( "maven.scm.cvs.use_compression", "true" ).equals( "false"
) )
+        {
+            cl.createArgument().setValue( "-z3" );
+        }
+
+        cl.createArgument().setValue( "-f" ); // don't use ~/.cvsrc
+
+        cl.createArgument().setValue( "-d" );
+
+        cl.createArgument().setValue( repo.getCvsRoot() );
+
+        cl.createArgument().setLine( options );
+
+        cl.createArgument().setValue( "-q" );
+
+        cl.createArgument().setValue( commandName );
+
+        return cl;
+    }
+}

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

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

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/add/CvsAddCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/add/CvsAddCommand.java?rev=374628&r1=374627&r2=374628&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/add/CvsAddCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/add/CvsAddCommand.java
Fri Feb  3 02:00:04 2006
@@ -25,6 +25,7 @@
 import org.apache.maven.scm.command.add.AddScmResult;
 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.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
@@ -49,21 +50,7 @@
     {
         CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
 
-        Commandline cl = new Commandline();
-
-        cl.setExecutable( "cvs" );
-
-        cl.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() );
-
-        cl.createArgument().setValue( "-f" ); // don't use ~/.cvsrc
-
-        cl.createArgument().setValue( "-d" );
-
-        cl.createArgument().setValue( repository.getCvsRoot() );
-
-        cl.createArgument().setValue( "-q" );
-
-        cl.createArgument().setValue( "add" );
+        Commandline cl = CvsCommandUtils.getBaseCommand( "add", repository, fileSet);
 
         if ( binary )
         {

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommand.java?rev=374628&r1=374627&r2=374628&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommand.java
Fri Feb  3 02:00:04 2006
@@ -23,6 +23,7 @@
 import org.apache.maven.scm.command.changelog.ChangeLogSet;
 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.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
@@ -62,26 +63,7 @@
     {
         CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
 
-        Commandline cl = new Commandline();
-
-        cl.setExecutable( "cvs" );
-
-        cl.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() );
-
-        if ( !System.getProperty( "maven.scm.cvs.use_compression", "true" ).equals( "false"
) )
-        {
-            cl.createArgument().setValue( "-z3" );
-        }
-
-        cl.createArgument().setValue( "-f" ); // don't use ~/.cvsrc
-
-        cl.createArgument().setValue( "-d" );
-
-        cl.createArgument().setValue( repository.getCvsRoot() );
-
-        cl.createArgument().setValue( "-q" );
-
-        cl.createArgument().setValue( "log" );
+        Commandline cl = CvsCommandUtils.getBaseCommand( "log", repository, fileSet);
 
         if ( startDate != null )
         {

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInCommand.java?rev=374628&r1=374627&r2=374628&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInCommand.java
Fri Feb  3 02:00:04 2006
@@ -22,6 +22,7 @@
 import org.apache.maven.scm.command.checkin.CheckInScmResult;
 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.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
@@ -47,13 +48,16 @@
     {
         CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
 
-        Commandline cl = new Commandline();
+        Commandline cl = CvsCommandUtils.getBaseCommand( "commit", repository, fileSet);
 
-        cl.setExecutable( "cvs" );
+        if ( !StringUtils.isEmpty( tag ) )
+        {
+            cl.createArgument().setValue( "-r" + tag );
+        }
 
-        cl.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() );
+        cl.createArgument().setValue( "-R" );
 
-        cl.createArgument().setValue( "-f" ); // don't use ~/.cvsrc
+        cl.createArgument().setValue( "-F" );
 
         File messageFile;
 
@@ -67,23 +71,6 @@
         {
             throw new ScmException( "Error while making a temporary commit message file."
);
         }
-
-        cl.createArgument().setValue( "-d" );
-
-        cl.createArgument().setValue( repository.getCvsRoot() );
-
-        cl.createArgument().setValue( "-q" );
-
-        cl.createArgument().setValue( "commit" );
-
-        if ( !StringUtils.isEmpty( tag ) )
-        {
-            cl.createArgument().setValue( "-r" + tag );
-        }
-
-        cl.createArgument().setValue( "-R" );
-
-        cl.createArgument().setValue( "-F" );
 
         cl.createArgument().setValue( messageFile.getAbsolutePath() );
 

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffCommand.java?rev=374628&r1=374627&r2=374628&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffCommand.java
Fri Feb  3 02:00:04 2006
@@ -22,12 +22,12 @@
 import org.apache.maven.scm.command.diff.DiffScmResult;
 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.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 
-import java.io.File;
-
 /**
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  * @version $Id$
@@ -40,7 +40,7 @@
                                                 String endRevision )
         throws ScmException
     {
-        Commandline cl = createCommandLine( fileSet.getBasedir(), startRevision, endRevision
);
+        Commandline cl = createCommandLine( repo, fileSet, startRevision, endRevision );
 
         CvsDiffConsumer consumer = new CvsDiffConsumer( getLogger(), fileSet.getBasedir()
);
 
@@ -77,19 +77,12 @@
     //
     // ----------------------------------------------------------------------
 
-    public static Commandline createCommandLine( File workingDirectory, String startRevision,
String endRevision )
+    public static Commandline createCommandLine( ScmProviderRepository repo, ScmFileSet fileSet,
String startRevision,
+                                                 String endRevision )
     {
-        Commandline cl = new Commandline();
-
-        cl.setExecutable( "cvs" );
-
-        cl.setWorkingDirectory( workingDirectory.getAbsolutePath() );
-
-        cl.createArgument().setValue( "-q" );
-
-        cl.createArgument().setValue( "-f" ); // don't use ~/.cvsrc
+        CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
 
-        cl.createArgument().setValue( "diff" );
+        Commandline cl = CvsCommandUtils.getBaseCommand( "diff", repository, fileSet );
 
         cl.createArgument().setValue( "-u" );
 

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/remove/CvsRemoveCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/remove/CvsRemoveCommand.java?rev=374628&r1=374627&r2=374628&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/remove/CvsRemoveCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/remove/CvsRemoveCommand.java
Fri Feb  3 02:00:04 2006
@@ -25,6 +25,7 @@
 import org.apache.maven.scm.command.remove.RemoveScmResult;
 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.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
@@ -48,21 +49,7 @@
     {
         CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
 
-        Commandline cl = new Commandline();
-
-        cl.setExecutable( "cvs" );
-
-        cl.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() );
-
-        cl.createArgument().setValue( "-f" ); // don't use ~/.cvsrc
-
-        cl.createArgument().setValue( "-d" );
-
-        cl.createArgument().setValue( repository.getCvsRoot() );
-
-        cl.createArgument().setValue( "-q" );
-
-        cl.createArgument().setValue( "remove" );
+        Commandline cl = CvsCommandUtils.getBaseCommand( "remove", repository, fileSet );
 
         cl.createArgument().setValue( "-f" );
 

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusCommand.java?rev=374628&r1=374627&r2=374628&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusCommand.java
Fri Feb  3 02:00:04 2006
@@ -22,6 +22,8 @@
 import org.apache.maven.scm.command.status.StatusScmResult;
 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.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
@@ -37,7 +39,11 @@
     protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet
fileSet )
         throws ScmException
     {
-        Commandline cl = createCommandLine( fileSet );
+        CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
+
+        Commandline cl = CvsCommandUtils.getBaseCommand( "update", repository, fileSet, "-n"
);
+
+        cl.createArgument().setValue( "-d" );
 
         CvsStatusConsumer consumer = new CvsStatusConsumer( getLogger(), fileSet.getBasedir()
);
 
@@ -66,27 +72,5 @@
         }
 
         return new StatusScmResult( cl.toString(), consumer.getChangedFiles() );
-    }
-
-    public Commandline createCommandLine( ScmFileSet fileSet )
-        throws ScmException
-    {
-        Commandline cl = new Commandline();
-
-        cl.setExecutable( "cvs" );
-
-        cl.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() );
-
-        cl.createArgument().setValue( "-f" ); // don't use ~/.cvsrc
-
-        cl.createArgument().setValue( "-n" );
-
-        cl.createArgument().setValue( "-q" );
-
-        cl.createArgument().setValue( "update" );
-
-        cl.createArgument().setValue( "-d" );
-
-        return cl;
     }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagCommand.java?rev=374628&r1=374627&r2=374628&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagCommand.java
Fri Feb  3 02:00:04 2006
@@ -23,6 +23,7 @@
 import org.apache.maven.scm.command.tag.TagScmResult;
 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.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
@@ -42,21 +43,7 @@
     {
         CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
 
-        Commandline cl = new Commandline();
-
-        cl.setExecutable( "cvs" );
-
-        cl.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() );
-
-        cl.createArgument().setValue( "-f" ); // don't use ~/.cvsrc
-
-        cl.createArgument().setValue( "-d" );
-
-        cl.createArgument().setValue( repository.getCvsRoot() );
-
-        cl.createArgument().setValue( "-q" );
-
-        cl.createArgument().setValue( "tag" );
+        Commandline cl = CvsCommandUtils.getBaseCommand( "tag", repository, fileSet );
 
         cl.createArgument().setValue( "-F" );
 

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommand.java?rev=374628&r1=374627&r2=374628&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommand.java
Fri Feb  3 02:00:04 2006
@@ -23,7 +23,9 @@
 import org.apache.maven.scm.command.update.UpdateScmResult;
 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.command.changelog.CvsChangeLogCommand;
+import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository;
 import org.codehaus.plexus.util.cli.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
@@ -40,17 +42,9 @@
     public UpdateScmResult executeUpdateCommand( ScmProviderRepository repo, ScmFileSet fileSet,
String tag )
         throws ScmException
     {
-        Commandline cl = new Commandline();
+        CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
 
-        cl.setExecutable( "cvs" );
-
-        cl.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() );
-
-        cl.createArgument().setValue( "-f" ); // don't use ~/.cvsrc
-
-        cl.createArgument().setValue( "-q" );
-
-        cl.createArgument().setValue( "update" );
+        Commandline cl = CvsCommandUtils.getBaseCommand( "update", repository, fileSet );
 
         cl.createArgument().setValue( "-d" );
 
@@ -63,13 +57,10 @@
 
         CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
 
-        getLogger().info( "Executing: " + cl );
-        getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath()
);
+        getLogger().debug( "Executing: " + cl );
+        getLogger().debug( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath()
);
 
         int exitCode;
-
-        getLogger().debug( "Working directory: " + fileSet.getBasedir().getAbsolutePath()
);
-        getLogger().debug( "Command line: " + cl );
 
         try
         {

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommandTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommandTest.java?rev=374628&r1=374627&r2=374628&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommandTest.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommandTest.java
Fri Feb  3 02:00:04 2006
@@ -70,7 +70,7 @@
     {
         ScmManager scmManager = getScmManager();
 
-        String scmUrl = "scm:cvs:local:" + repository.getAbsolutePath() + ":" + getModule();
+        String scmUrl = "scm:cvs|local|" + repository.getAbsolutePath() + "|" + getModule();
 
         // Check out the repo to a workding directory where files will be modified and committed
         String arguments =



Mime
View raw message