maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r524909 [1/4] - in /maven/scm/trunk: maven-scm-api/src/main/java/org/apache/maven/scm/ maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/ maven-scm-api/src/m...
Date Mon, 02 Apr 2007 20:02:50 GMT
Author: evenisse
Date: Mon Apr  2 13:02:44 2007
New Revision: 524909

URL: http://svn.apache.org/viewvc?view=rev&rev=524909
Log:
[SCM-21] Separate revision/branch/tag handling
Each method get now a ScmVersion that can be a ScmRevision, ScmBranch or ScmTag, so the developer provider can now do different statement based on this scmVersion.

Added:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/AbstractScmVersion.java   (with props)
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmBranch.java   (with props)
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmRevision.java   (with props)
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTag.java   (with props)
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmVersion.java   (with props)
Modified:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameters.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/AbstractChangeLogCommand.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/AbstractCheckInCommand.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/AbstractDiffCommand.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/export/AbstractExportCommand.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListCommand.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/tag/AbstractTagCommand.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java
    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-client/src/main/java/org/apache/maven/scm/client/cli/MavenScmCli.java
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ChangeLogMojo.java
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckinMojo.java
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DiffMojo.java
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ExportMojo.java
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ListMojo.java
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateMojo.java
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateSubprojectsMojo.java
    maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/tag/checkout.xml
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/changelog/BazaarChangeLogCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkin/BazaarCheckInCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkout/BazaarCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/diff/BazaarDiffCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/update/BazaarUpdateCommand.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/checkin/ClearCaseCheckInCommand.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/update/ClearCaseUpdateCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/changelog/LocalChangeLogCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkin/LocalCheckInCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/list/LocalListCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/metadata/LocalScmMetadataUtils.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/mdo/maven-scm-local-metadata.mdo
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommandTckTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateCommandTckTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/diff/PerforceDiffCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/update/PerforceUpdateCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/diff/PerforceDiffCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/diff/StarteamDiffCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/diff/StarteamDiffCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/changelog/SynergyChangeLogCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkin/SynergyCheckInCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkout/SynergyCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/update/SynergyUpdateCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyCCM.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyUtil.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssHistoryCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/update/VssUpdateCommand.java
    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/changelog/AbstractCvsChangeLogCommand.java
    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/checkin/AbstractCvsCheckInCommand.java
    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/checkout/AbstractCvsCheckOutCommand.java
    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/diff/AbstractCvsDiffCommand.java
    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/export/AbstractCvsExportCommand.java
    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
    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/update/AbstractCvsUpdateCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckoutCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtils.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtilsTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/changelog/SvnChangeLogCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkin/SvnCheckInCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/diff/SvnDiffCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/export/SvnExeExportCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/tag/SvnTagCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/update/SvnUpdateCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/changelog/SvnChangeLogCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/update/SvnUpdateCommandTest.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/ScmTckTestCase.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/changelog/ChangeLogCommandTckTest.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/checkin/CheckInCommandTckTest.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/diff/DiffCommandTckTest.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/list/ListCommandTckTest.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/status/StatusCommandTckTest.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/tag/TagCommandTckTest.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckTest.java

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/AbstractScmVersion.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/AbstractScmVersion.java?view=auto&rev=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/AbstractScmVersion.java (added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/AbstractScmVersion.java Mon Apr  2 13:02:44 2007
@@ -0,0 +1,57 @@
+package org.apache.maven.scm;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public abstract class AbstractScmVersion
+    implements ScmVersion
+{
+    private String name;
+
+    public AbstractScmVersion( String name )
+    {
+        setName( name );
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName( String name )
+    {
+        if ( name != null )
+        {
+            name = name.trim();
+        }
+        this.name = name;
+    }
+
+    /**
+     * @return the version name
+     */
+    public String toString()
+    {
+        return getName();
+    }
+}

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

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

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java?view=diff&rev=524909&r1=524908&r2=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java Mon Apr  2 13:02:44 2007
@@ -41,21 +41,19 @@
 
     public final static CommandParameter BRANCH = new CommandParameter( "branch" );
 
-    public final static CommandParameter START_TAG = new CommandParameter( "startTag" );
+    public final static CommandParameter START_SCM_VERSION = new CommandParameter( "startScmVersion" );
 
-    public final static CommandParameter END_TAG = new CommandParameter( "endTag" );
+    public final static CommandParameter END_SCM_VERSION = new CommandParameter( "endScmVersion" );
 
     public final static CommandParameter CHANGELOG_DATE_PATTERN = new CommandParameter( "changelogDatePattern" );
 
-    public final static CommandParameter TAG = new CommandParameter( "tag" );
+    public final static CommandParameter SCM_VERSION = new CommandParameter( "scmVersion" );
+
+    public final static CommandParameter TAG_NAME = new CommandParameter( "tagName" );
 
     public final static CommandParameter FILE = new CommandParameter( "file" );
 
     public final static CommandParameter FILES = new CommandParameter( "files" );
-
-    public final static CommandParameter START_REVISION = new CommandParameter( "startRevision" );
-
-    public final static CommandParameter END_REVISION = new CommandParameter( "endRevision" );
 
     public final static CommandParameter OUTPUT_FILE = new CommandParameter( "outputFile" );
 

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameters.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameters.java?view=diff&rev=524909&r1=524908&r2=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameters.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameters.java Mon Apr  2 13:02:44 2007
@@ -111,7 +111,7 @@
      * Return the parameter value as int or the default value if it doesn't exist.
      *
      * @param parameter The parameter
-     * @return The parameter value as a String
+     * @return The parameter value as a int
      * @throws ScmException if the value is in the wrong type
      */
     public int getInt( CommandParameter parameter, int defaultValue )
@@ -148,7 +148,7 @@
      * Return the parameter value as Date.
      *
      * @param parameter The parameter
-     * @return The parameter value as a String
+     * @return The parameter value as a Date
      * @throws ScmException if the parameter doesn't exist
      */
     public Date getDate( CommandParameter parameter )
@@ -161,7 +161,7 @@
      * Return the parameter value as String or the default value if it doesn't exist.
      *
      * @param parameter The parameter
-     * @return The parameter value as a String
+     * @return The parameter value as a Date
      * @throws ScmException if the value is in the wrong type
      */
     public Date getDate( CommandParameter parameter, Date defaultValue )
@@ -198,6 +198,50 @@
         throws ScmException
     {
         return Boolean.valueOf( getString( parameter ) ).booleanValue();
+    }
+
+    // ----------------------------------------------------------------------
+    // ScmVersion
+    // ----------------------------------------------------------------------
+
+    /**
+     * Return the parameter value as ScmVersion.
+     *
+     * @param parameter The parameter
+     * @return The parameter value as a ScmVersion
+     * @throws ScmException if the parameter doesn't exist
+     */
+    public ScmVersion getScmVersion( CommandParameter parameter )
+        throws ScmException
+    {
+        return (ScmVersion) getObject( ScmVersion.class, parameter );
+    }
+
+    /**
+     * Return the parameter value as ScmVersion or the default value.
+     *
+     * @param parameter    The parameter
+     * @param defaultValue The default value
+     * @return The parameter value as a ScmVersion
+     * @throws ScmException if the parameter doesn't exist
+     */
+    public ScmVersion getScmVersion( CommandParameter parameter, ScmVersion defaultValue )
+        throws ScmException
+    {
+        return (ScmVersion) getObject( ScmVersion.class, parameter, defaultValue );
+    }
+
+    /**
+     * Set a parameter value.
+     *
+     * @param parameter  The parameter name
+     * @param scmVersion The tbranch/tag/revision
+     * @throws ScmException if the parameter already exist
+     */
+    public void setScmVersion( CommandParameter parameter, ScmVersion scmVersion )
+        throws ScmException
+    {
+        setObject( parameter, scmVersion );
     }
 
     // ----------------------------------------------------------------------

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmBranch.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmBranch.java?view=auto&rev=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmBranch.java (added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmBranch.java Mon Apr  2 13:02:44 2007
@@ -0,0 +1,38 @@
+package org.apache.maven.scm;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class ScmBranch
+    extends AbstractScmVersion
+{
+    public String getType()
+    {
+        return "Branch";
+    }
+
+    public ScmBranch( String name )
+    {
+        super( name );
+    }
+}

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

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

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmRevision.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmRevision.java?view=auto&rev=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmRevision.java (added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmRevision.java Mon Apr  2 13:02:44 2007
@@ -0,0 +1,38 @@
+package org.apache.maven.scm;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class ScmRevision
+    extends AbstractScmVersion
+{
+    public String getType()
+    {
+        return "Revision";
+    }
+
+    public ScmRevision( String name )
+    {
+        super( name );
+    }
+}

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

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

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTag.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTag.java?view=auto&rev=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTag.java (added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTag.java Mon Apr  2 13:02:44 2007
@@ -0,0 +1,38 @@
+package org.apache.maven.scm;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class ScmTag
+    extends ScmBranch
+{
+    public String getType()
+    {
+        return "Tag";
+    }
+
+    public ScmTag( String name )
+    {
+        super( name );
+    }
+}

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

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

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmVersion.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmVersion.java?view=auto&rev=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmVersion.java (added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmVersion.java Mon Apr  2 13:02:44 2007
@@ -0,0 +1,33 @@
+package org.apache.maven.scm;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public interface ScmVersion
+{
+    String getType();
+
+    String getName();
+
+    void setName( String name );
+}

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

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

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/AbstractChangeLogCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/AbstractChangeLogCommand.java?view=diff&rev=524909&r1=524908&r2=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/AbstractChangeLogCommand.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/AbstractChangeLogCommand.java Mon Apr  2 13:02:44 2007
@@ -21,9 +21,11 @@
 
 import org.apache.maven.scm.CommandParameter;
 import org.apache.maven.scm.CommandParameters;
+import org.apache.maven.scm.ScmBranch;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.ScmVersion;
 import org.apache.maven.scm.command.AbstractCommand;
 import org.apache.maven.scm.provider.ScmProviderRepository;
 import org.codehaus.plexus.util.StringUtils;
@@ -39,12 +41,13 @@
     implements ChangeLogCommand
 {
     protected abstract ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repository, ScmFileSet fileSet,
-                                                                   Date startDate, Date endDate, String branch,
+                                                                   Date startDate, Date endDate, ScmBranch branch,
                                                                    String datePattern )
         throws ScmException;
 
     protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repository, ScmFileSet fileSet,
-                                                          String startTag, String endTag, String datePattern )
+                                                          ScmVersion startVersion, ScmVersion endVersion,
+                                                          String datePattern )
         throws ScmException
     {
         throw new ScmException( "Unsupported method for this provider." );
@@ -60,17 +63,17 @@
 
         int numDays = parameters.getInt( CommandParameter.NUM_DAYS, 0 );
 
-        String branch = parameters.getString( CommandParameter.BRANCH, null );
+        ScmBranch branch = (ScmBranch) parameters.getScmVersion( CommandParameter.BRANCH, null );
 
-        String startTag = parameters.getString( CommandParameter.START_TAG, null );
+        ScmVersion startVersion = parameters.getScmVersion( CommandParameter.START_SCM_VERSION, null );
 
-        String endTag = parameters.getString( CommandParameter.END_TAG, null );
+        ScmVersion endVersion = parameters.getScmVersion( CommandParameter.END_SCM_VERSION, null );
 
         String datePattern = parameters.getString( CommandParameter.CHANGELOG_DATE_PATTERN, null );
 
-        if ( !StringUtils.isEmpty( startTag ) )
+        if ( startVersion != null && StringUtils.isNotEmpty( startVersion.getName() ) )
         {
-            return executeChangeLogCommand( repository, fileSet, startTag, endTag, datePattern );
+            return executeChangeLogCommand( repository, fileSet, startVersion, endVersion, datePattern );
         }
         else
         {

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/AbstractCheckInCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/AbstractCheckInCommand.java?view=diff&rev=524909&r1=524908&r2=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/AbstractCheckInCommand.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/AbstractCheckInCommand.java Mon Apr  2 13:02:44 2007
@@ -24,6 +24,7 @@
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.ScmVersion;
 import org.apache.maven.scm.command.AbstractCommand;
 import org.apache.maven.scm.provider.ScmProviderRepository;
 
@@ -38,7 +39,7 @@
     public final static String NAME = "check-in";
 
     protected abstract CheckInScmResult executeCheckInCommand( ScmProviderRepository repository, ScmFileSet fileSet,
-                                                               String message, String tag )
+                                                               String message, ScmVersion scmVersion )
         throws ScmException;
 
     public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
@@ -47,8 +48,8 @@
     {
         String message = parameters.getString( CommandParameter.MESSAGE );
 
-        String tag = parameters.getString( CommandParameter.TAG, null );
+        ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null );
 
-        return executeCheckInCommand( repository, fileSet, message, tag );
+        return executeCheckInCommand( repository, fileSet, message, scmVersion );
     }
 }

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java?view=diff&rev=524909&r1=524908&r2=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java Mon Apr  2 13:02:44 2007
@@ -24,6 +24,7 @@
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.ScmVersion;
 import org.apache.maven.scm.command.AbstractCommand;
 import org.apache.maven.scm.provider.ScmProviderRepository;
 
@@ -36,15 +37,15 @@
     extends AbstractCommand
 {
     protected abstract CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet,
-                                                                 String tag )
+                                                                 ScmVersion scmVersion )
         throws ScmException;
 
     public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
                                      CommandParameters parameters )
         throws ScmException
     {
-        String tag = parameters.getString( CommandParameter.TAG, null );
+        ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null );
 
-        return executeCheckOutCommand( repository, fileSet, tag );
+        return executeCheckOutCommand( repository, fileSet, scmVersion );
     }
 }

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/AbstractDiffCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/AbstractDiffCommand.java?view=diff&rev=524909&r1=524908&r2=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/AbstractDiffCommand.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/AbstractDiffCommand.java Mon Apr  2 13:02:44 2007
@@ -24,6 +24,7 @@
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.ScmVersion;
 import org.apache.maven.scm.command.AbstractCommand;
 import org.apache.maven.scm.provider.ScmProviderRepository;
 
@@ -41,16 +42,16 @@
     extends AbstractCommand
 {
     protected abstract DiffScmResult executeDiffCommand( ScmProviderRepository repository, ScmFileSet fileSet,
-                                                         String startRevision, String endRevision )
+                                                         ScmVersion startRevision, ScmVersion endRevision )
         throws ScmException;
 
     public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
                                      CommandParameters parameters )
         throws ScmException
     {
-        String startRevision = parameters.getString( CommandParameter.START_REVISION, null );
+        ScmVersion startRevision = parameters.getScmVersion( CommandParameter.START_SCM_VERSION, null );
 
-        String endRevision = parameters.getString( CommandParameter.END_REVISION, null );
+        ScmVersion endRevision = parameters.getScmVersion( CommandParameter.END_SCM_VERSION, null );
 
         return executeDiffCommand( repository, fileSet, startRevision, endRevision );
     }

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/export/AbstractExportCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/export/AbstractExportCommand.java?view=diff&rev=524909&r1=524908&r2=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/export/AbstractExportCommand.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/export/AbstractExportCommand.java Mon Apr  2 13:02:44 2007
@@ -24,6 +24,7 @@
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.ScmVersion;
 import org.apache.maven.scm.command.AbstractCommand;
 import org.apache.maven.scm.provider.ScmProviderRepository;
 
@@ -35,17 +36,17 @@
     extends AbstractCommand
 {
     protected abstract ExportScmResult executeExportCommand( ScmProviderRepository repository, ScmFileSet fileSet,
-                                                             String tag, String outputDirectory )
+                                                             ScmVersion scmVersion, String outputDirectory )
         throws ScmException;
 
     protected ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
                                         CommandParameters parameters )
         throws ScmException
     {
-        String tag = parameters.getString( CommandParameter.TAG, null );
+        ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null );
 
         String outputDirectory = parameters.getString( CommandParameter.OUTPUT_DIRECTORY, null );
 
-        return executeExportCommand( repository, fileSet, tag, outputDirectory );
+        return executeExportCommand( repository, fileSet, scmVersion, outputDirectory );
     }
 }

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListCommand.java?view=diff&rev=524909&r1=524908&r2=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListCommand.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListCommand.java Mon Apr  2 13:02:44 2007
@@ -24,6 +24,7 @@
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.ScmVersion;
 import org.apache.maven.scm.command.AbstractCommand;
 import org.apache.maven.scm.provider.ScmProviderRepository;
 
@@ -44,7 +45,7 @@
      * @throws ScmException
      */
     protected abstract ListScmResult executeListCommand( ScmProviderRepository repository, ScmFileSet fileSet,
-                                                         boolean recursive, String tag )
+                                                         boolean recursive, ScmVersion scmVersion )
         throws ScmException;
 
     public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
@@ -58,8 +59,8 @@
 
         boolean recursive = parameters.getBoolean( CommandParameter.RECURSIVE );
 
-        String tag = parameters.getString( CommandParameter.TAG, null );
+        ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null );
 
-        return executeListCommand( repository, fileSet, recursive, tag );
+        return executeListCommand( repository, fileSet, recursive, scmVersion );
     }
 }

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/tag/AbstractTagCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/tag/AbstractTagCommand.java?view=diff&rev=524909&r1=524908&r2=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/tag/AbstractTagCommand.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/tag/AbstractTagCommand.java Mon Apr  2 13:02:44 2007
@@ -35,15 +35,16 @@
 public abstract class AbstractTagCommand
     extends AbstractCommand
 {
-    protected abstract ScmResult executeTagCommand( ScmProviderRepository repository, ScmFileSet fileSet, String tag )
+    protected abstract ScmResult executeTagCommand( ScmProviderRepository repository, ScmFileSet fileSet,
+                                                    String tagName )
         throws ScmException;
 
     public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
                                      CommandParameters parameters )
         throws ScmException
     {
-        String tag = parameters.getString( CommandParameter.TAG );
+        String tagName = parameters.getString( CommandParameter.TAG_NAME );
 
-        return executeTagCommand( repository, fileSet, tag );
+        return executeTagCommand( repository, fileSet, tagName );
     }
 }

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java?view=diff&rev=524909&r1=524908&r2=524909
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java Mon Apr  2 13:02:44 2007
@@ -26,6 +26,7 @@
 import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.ScmVersion;
 import org.apache.maven.scm.command.AbstractCommand;
 import org.apache.maven.scm.command.changelog.ChangeLogCommand;
 import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
@@ -46,19 +47,19 @@
     extends AbstractCommand
 {
     protected abstract UpdateScmResult executeUpdateCommand( ScmProviderRepository repository, ScmFileSet fileSet,
-                                                             String tag )
+                                                             ScmVersion scmVersion )
         throws ScmException;
 
     public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
                                      CommandParameters parameters )
         throws ScmException
     {
-        String tag = parameters.getString( CommandParameter.TAG, null );
+        ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null );
 
         boolean runChangelog = Boolean.valueOf(
             parameters.getString( CommandParameter.RUN_CHANGELOG_WITH_UPDATE, "true" ) ).booleanValue();
 
-        UpdateScmResult updateScmResult = executeUpdateCommand( repository, fileSet, tag );
+        UpdateScmResult updateScmResult = executeUpdateCommand( repository, fileSet, scmVersion );
 
         List filesList = updateScmResult.getUpdatedFiles();
 

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java?view=diff&rev=524909&r1=524908&r2=524909
==============================================================================
--- 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 Apr  2 13:02:44 2007
@@ -22,8 +22,11 @@
 import org.apache.maven.scm.CommandParameter;
 import org.apache.maven.scm.CommandParameters;
 import org.apache.maven.scm.NoSuchCommandScmException;
+import org.apache.maven.scm.ScmBranch;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmRevision;
+import org.apache.maven.scm.ScmVersion;
 import org.apache.maven.scm.command.add.AddScmResult;
 import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
 import org.apache.maven.scm.command.checkin.CheckInScmResult;
@@ -70,8 +73,8 @@
     }
 
     /**
-    * @see org.apache.maven.scm.provider.ScmProvider#sanitizeTagName(java.lang.String)
-    */
+     * @see org.apache.maven.scm.provider.ScmProvider#sanitizeTagName(java.lang.String)
+     */
     public String sanitizeTagName( String tag )
     {
         /* by default, we assume all tags are valid. */
@@ -79,8 +82,8 @@
     }
 
     /**
-    * @see org.apache.maven.scm.provider.ScmProvider#validateTagName(java.lang.String)
-    */
+     * @see org.apache.maven.scm.provider.ScmProvider#validateTagName(java.lang.String)
+     */
     public boolean validateTagName( String tag )
     {
         /* by default, we assume all tags are valid. */
@@ -149,6 +152,7 @@
 
     /**
      * @see org.apache.maven.scm.provider.ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.util.Date,java.util.Date,int,java.lang.String)
+     * @deprecated
      */
     public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate,
                                          int numDays, String branch )
@@ -159,11 +163,39 @@
 
     /**
      * @see org.apache.maven.scm.provider.ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.util.Date,java.util.Date,int,java.lang.String,java.lang.String)
+     * @deprecated
      */
     public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate,
                                          int numDays, String branch, String datePattern )
         throws ScmException
     {
+        ScmBranch scmBranch = null;
+
+        if ( StringUtils.isNotEmpty( branch ) )
+        {
+            scmBranch = new ScmBranch( branch );
+        }
+        return changeLog( repository, fileSet, startDate, endDate, numDays, scmBranch, null );
+
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.util.Date,java.util.Date,int,ScmBranch)
+     */
+    public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate,
+                                         int numDays, ScmBranch branch )
+        throws ScmException
+    {
+        return changeLog( repository, fileSet, startDate, endDate, numDays, branch, null );
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.util.Date,java.util.Date,int,ScmBranch,String)
+     */
+    public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate,
+                                         int numDays, ScmBranch branch, String datePattern )
+        throws ScmException
+    {
         login( repository, fileSet );
 
         CommandParameters parameters = new CommandParameters();
@@ -174,7 +206,7 @@
 
         parameters.setInt( CommandParameter.NUM_DAYS, numDays );
 
-        parameters.setString( CommandParameter.BRANCH, branch );
+        parameters.setScmVersion( CommandParameter.BRANCH, branch );
 
         parameters.setString( CommandParameter.CHANGELOG_DATE_PATTERN, datePattern );
 
@@ -183,6 +215,7 @@
 
     /**
      * @see org.apache.maven.scm.provider.ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,java.lang.String)
+     * @deprecated
      */
     public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, String startTag, String endTag )
         throws ScmException
@@ -192,18 +225,52 @@
 
     /**
      * @see org.apache.maven.scm.provider.ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,java.lang.String,java.lang.String)
+     * @deprecated
      */
     public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, String startTag, String endTag,
                                          String datePattern )
         throws ScmException
     {
+        ScmVersion startRevision = null;
+        ScmVersion endRevision = null;
+
+        if ( StringUtils.isNotEmpty( startTag ) )
+        {
+            startRevision = new ScmRevision( startTag );
+        }
+
+        if ( StringUtils.isNotEmpty( endTag ) )
+        {
+            endRevision = new ScmRevision( endTag );
+        }
+
+        return changeLog( repository, fileSet, startRevision, endRevision, null );
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,ScmVersion,ScmVersion)
+     */
+    public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion,
+                                         ScmVersion endVersion )
+        throws ScmException
+    {
+        return changeLog( repository, fileSet, startVersion, endVersion, null );
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,ScmVersion,ScmVersion,java.lang.String)
+     */
+    public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion,
+                                         ScmVersion endVersion, String datePattern )
+        throws ScmException
+    {
         login( repository, fileSet );
 
         CommandParameters parameters = new CommandParameters();
 
-        parameters.setString( CommandParameter.START_TAG, startTag );
+        parameters.setScmVersion( CommandParameter.START_SCM_VERSION, startVersion );
 
-        parameters.setString( CommandParameter.END_TAG, endTag );
+        parameters.setScmVersion( CommandParameter.END_SCM_VERSION, endVersion );
 
         parameters.setString( CommandParameter.CHANGELOG_DATE_PATTERN, datePattern );
 
@@ -218,15 +285,33 @@
 
     /**
      * @see org.apache.maven.scm.provider.ScmProvider#checkIn(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,java.lang.String)
+     * @deprecated
      */
     public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String tag, String message )
         throws ScmException
     {
+        ScmVersion scmVersion = null;
+
+        if ( StringUtils.isNotEmpty( tag ) )
+        {
+            scmVersion = new ScmBranch( tag );
+        }
+
+        return checkIn( repository, fileSet, scmVersion, message );
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#checkIn(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,ScmVersion,java.lang.String)
+     */
+    public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion,
+                                     String message )
+        throws ScmException
+    {
         login( repository, fileSet );
 
         CommandParameters parameters = new CommandParameters();
 
-        parameters.setString( CommandParameter.TAG, tag );
+        parameters.setScmVersion( CommandParameter.SCM_VERSION, scmVersion );
 
         parameters.setString( CommandParameter.MESSAGE, message );
 
@@ -241,6 +326,7 @@
 
     /**
      * @see org.apache.maven.scm.provider.ScmProvider#checkOut(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String)
+     * @deprecated
      */
     public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, String tag )
         throws ScmException
@@ -248,14 +334,44 @@
         return checkOut( repository, fileSet, tag, true );
     }
 
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#checkOut(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,boolean)
+     * @deprecated
+     */
     public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, String tag, boolean recursive )
         throws ScmException
     {
+        ScmVersion scmVersion = null;
+
+        if ( StringUtils.isNotEmpty( tag ) )
+        {
+            scmVersion = new ScmRevision( tag );
+        }
+
+        return checkOut( repository, fileSet, scmVersion, recursive );
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#checkOut(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String)
+     */
+    public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion )
+        throws ScmException
+    {
+        return checkOut( repository, fileSet, scmVersion, true );
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#checkOut(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,boolean)
+     */
+    public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion,
+                                       boolean recursive )
+        throws ScmException
+    {
         login( repository, fileSet );
 
         CommandParameters parameters = new CommandParameters();
 
-        parameters.setString( CommandParameter.TAG, tag );
+        parameters.setScmVersion( CommandParameter.SCM_VERSION, scmVersion );
 
         parameters.setString( CommandParameter.RECURSIVE, recursive + "" );
 
@@ -268,20 +384,122 @@
         throw new NoSuchCommandScmException( "checkout" );
     }
 
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#diff(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,java.lang.String)
+     * @deprecated
+     */
+    public DiffScmResult diff( ScmRepository repository, ScmFileSet fileSet, String startRevision, String endRevision )
+        throws ScmException
+    {
+        ScmVersion startVersion = null;
+        ScmVersion endVersion = null;
+
+        if ( StringUtils.isNotEmpty( startRevision ) )
+        {
+            startVersion = new ScmRevision( startRevision );
+        }
+
+        if ( StringUtils.isNotEmpty( endRevision ) )
+        {
+            endVersion = new ScmRevision( endRevision );
+        }
+
+        return diff( repository, fileSet, startVersion, endVersion );
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#diff(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,ScmVersion,ScmVersion)
+     */
+    public DiffScmResult diff( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion,
+                               ScmVersion endVersion )
+        throws ScmException
+    {
+        login( repository, fileSet );
+
+        CommandParameters parameters = new CommandParameters();
+
+        parameters.setScmVersion( CommandParameter.START_SCM_VERSION, startVersion );
+
+        parameters.setScmVersion( CommandParameter.END_SCM_VERSION, endVersion );
+
+        return diff( repository, fileSet, parameters );
+    }
+
+    protected DiffScmResult diff( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        throw new NoSuchCommandScmException( "diff" );
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#edit(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet)
+     */
+    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
+    {
+        this.getLogger().warn( "Provider " + repository.getProvider() + " does not support edit operation." );
+
+        return new EditScmResult( "", null, null, true );
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#export(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String)
+     * @deprecated
+     */
     public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String tag )
         throws ScmException
     {
         return export( repository, fileSet, tag, null );
     }
 
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#export(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,String)
+     * @deprecated
+     */
     public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String tag, String outputDirectory )
         throws ScmException
     {
+        ScmVersion scmVersion = null;
+
+        if ( StringUtils.isNotEmpty( tag ) )
+        {
+            scmVersion = new ScmRevision( tag );
+        }
+
+        return export( repository, fileSet, scmVersion, outputDirectory );
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#export(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,ScmVersion)
+     */
+    public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion )
+        throws ScmException
+    {
+        return export( repository, fileSet, scmVersion, null );
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#export(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,ScmVersion,String)
+     */
+    public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion,
+                                   String outputDirectory )
+        throws ScmException
+    {
         login( repository, fileSet );
 
         CommandParameters parameters = new CommandParameters();
 
-        parameters.setString( CommandParameter.TAG, tag );
+        parameters.setScmVersion( CommandParameter.SCM_VERSION, scmVersion );
 
         parameters.setString( CommandParameter.OUTPUT_DIRECTORY, outputDirectory );
 
@@ -295,26 +513,55 @@
     }
 
     /**
-     * @see org.apache.maven.scm.provider.ScmProvider#diff(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,java.lang.String)
+     * @see org.apache.maven.scm.provider.ScmProvider#list(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,boolean,String)
      */
-    public DiffScmResult diff( ScmRepository repository, ScmFileSet fileSet, String startRevision, String endRevision )
+    public ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, String tag )
+        throws ScmException
+    {
+        ScmVersion scmVersion = null;
+
+        if ( StringUtils.isNotEmpty( tag ) )
+        {
+            scmVersion = new ScmRevision( tag );
+        }
+
+        return list( repository, fileSet, recursive, scmVersion );
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#list(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,boolean,org.apache.maven.scm.ScmVersion)
+     */
+    public ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion scmVersion )
         throws ScmException
     {
         login( repository, fileSet );
 
         CommandParameters parameters = new CommandParameters();
 
-        parameters.setString( CommandParameter.START_REVISION, startRevision );
+        parameters.setString( CommandParameter.RECURSIVE, Boolean.toString( recursive ) );
 
-        parameters.setString( CommandParameter.END_REVISION, endRevision );
+        if ( scmVersion != null )
+        {
+            parameters.setScmVersion( CommandParameter.SCM_VERSION, scmVersion );
+        }
 
-        return diff( repository, fileSet, parameters );
+        return list( repository, fileSet, parameters );
     }
 
-    protected DiffScmResult diff( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+    /**
+     * List each element (files and directories) of <B>fileSet</B> as they exist in the repository.
+     *
+     * @param repository the source control system
+     * @param fileSet    the files to list
+     * @param parameters
+     * @return The list of files in the repository
+     * @throws NoSuchCommandScmException unless overriden by subclass
+     * @throws ScmException
+     */
+    protected ListScmResult list( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters )
         throws ScmException
     {
-        throw new NoSuchCommandScmException( "diff" );
+        throw new NoSuchCommandScmException( "list" );
     }
 
     private void login( ScmRepository repository, ScmFileSet fileSet )
@@ -377,14 +624,14 @@
     /**
      * @see org.apache.maven.scm.provider.ScmProvider#tag(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String)
      */
-    public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tag )
+    public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName )
         throws ScmException
     {
         login( repository, fileSet );
 
         CommandParameters parameters = new CommandParameters();
 
-        parameters.setString( CommandParameter.TAG, tag );
+        parameters.setString( CommandParameter.TAG_NAME, tagName );
 
         return tag( repository, fileSet, parameters );
     }
@@ -396,7 +643,29 @@
     }
 
     /**
+     * @see org.apache.maven.scm.provider.ScmProvider#unedit(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet)
+     */
+    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
+    {
+        this.getLogger().warn( "Provider " + repository.getProvider() + " does not support unedit operation." );
+
+        return new UnEditScmResult( "", null, null, true );
+    }
+
+    /**
      * @see org.apache.maven.scm.provider.ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String)
+     * @deprecated
      */
     public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag )
         throws ScmException
@@ -406,6 +675,7 @@
 
     /**
      * @see org.apache.maven.scm.provider.ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,boolean)
+     * @deprecated
      */
     public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, boolean runChangelog )
         throws ScmException
@@ -414,154 +684,145 @@
     }
 
     /**
-     * @see org.apache.maven.scm.provider.ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,java.lang.String)
+     * @see org.apache.maven.scm.provider.ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,ScmVersion)
      */
-    public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, String datePattern )
+    public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion )
         throws ScmException
     {
-        return update( repository, fileSet, tag, datePattern, true );
+        return update( repository, fileSet, scmVersion, true );
     }
 
-    private UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, String datePattern,
-                                    boolean runChangelog )
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,ScmVersion,boolean)
+     */
+    public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion,
+                                   boolean runChangelog )
         throws ScmException
     {
-        login( repository, fileSet );
-
-        CommandParameters parameters = new CommandParameters();
-
-        parameters.setString( CommandParameter.TAG, tag );
-
-        parameters.setString( CommandParameter.CHANGELOG_DATE_PATTERN, datePattern );
-
-        parameters.setString( CommandParameter.RUN_CHANGELOG_WITH_UPDATE, String.valueOf( runChangelog ) );
-
-        return update( repository, fileSet, parameters );
+        return update( repository, fileSet, scmVersion, "", runChangelog );
     }
 
     /**
-     * @see org.apache.maven.scm.provider.ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,java.util.Date)
+     * @see org.apache.maven.scm.provider.ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,java.lang.String)
+     * @deprecated
      */
-    public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate )
+    public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, String datePattern )
         throws ScmException
     {
-        return update( repository, fileSet, tag, lastUpdate, null );
+        return update( repository, fileSet, tag, datePattern, true );
     }
 
     /**
-     * @see org.apache.maven.scm.provider.ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,java.util.Date,java.lang.String)
+     * @see org.apache.maven.scm.provider.ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,ScmVersion,java.lang.String)
      */
-    public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate,
+    public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion,
                                    String datePattern )
         throws ScmException
     {
-        return update( repository, fileSet, tag, lastUpdate, datePattern, true );
+        return update( repository, fileSet, scmVersion, datePattern, true );
     }
 
     /**
-     * @see org.apache.maven.scm.provider.ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,java.util.Date,java.lang.String,boolean)
+     * @deprecated
      */
-    public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate,
-                                   String datePattern, boolean runChangelog )
+    private UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, String datePattern,
+                                    boolean runChangelog )
         throws ScmException
     {
-        login( repository, fileSet );
+        ScmBranch scmBranch = null;
 
-        CommandParameters parameters = new CommandParameters();
-
-        parameters.setString( CommandParameter.TAG, tag );
-
-        if ( lastUpdate != null )
+        if ( StringUtils.isNotEmpty( tag ) )
         {
-            parameters.setDate( CommandParameter.START_DATE, lastUpdate );
+            scmBranch = new ScmBranch( tag );
         }
 
-        parameters.setString( CommandParameter.CHANGELOG_DATE_PATTERN, datePattern );
-
-        parameters.setString( CommandParameter.RUN_CHANGELOG_WITH_UPDATE, String.valueOf( runChangelog ) );
-
-        return update( repository, fileSet, parameters );
-    }
-
-    protected UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters )
-        throws ScmException
-    {
-        throw new NoSuchCommandScmException( "update" );
+        return update( repository, fileSet, scmBranch, datePattern, runChangelog );
     }
 
-    public EditScmResult edit( ScmRepository repository, ScmFileSet fileSet )
+    private UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion,
+                                    String datePattern, boolean runChangelog )
         throws ScmException
     {
         login( repository, fileSet );
 
         CommandParameters parameters = new CommandParameters();
 
-        return edit( repository, fileSet, parameters );
-    }
+        parameters.setScmVersion( CommandParameter.SCM_VERSION, scmVersion );
 
-    protected EditScmResult edit( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters )
-        throws ScmException
-    {
-        this.getLogger().warn( "Provider " + repository.getProvider() + " does not support edit operation." );
+        parameters.setString( CommandParameter.CHANGELOG_DATE_PATTERN, datePattern );
 
-        return new EditScmResult( "", null, null, true );
+        parameters.setString( CommandParameter.RUN_CHANGELOG_WITH_UPDATE, String.valueOf( runChangelog ) );
+
+        return update( repository, fileSet, parameters );
     }
 
-    public UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet )
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,java.util.Date)
+     * @deprecated
+     */
+    public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate )
         throws ScmException
     {
-        login( repository, fileSet );
-
-        CommandParameters parameters = new CommandParameters();
-
-        return unedit( repository, fileSet, parameters );
+        return update( repository, fileSet, tag, lastUpdate, null );
     }
 
-    protected UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,ScmVersion,java.util.Date)
+     */
+    public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion,
+                                   Date lastUpdate )
         throws ScmException
     {
-        this.getLogger().warn( "Provider " + repository.getProvider() + " does not support unedit operation." );
-
-        return new UnEditScmResult( "", null, null, true );
+        return update( repository, fileSet, scmVersion, lastUpdate, null );
     }
 
     /**
-     * List each element (files and directories) of <B>fileSet</B> as they exist in the repository.
-     *
-     * @param repository the source control system
-     * @param fileSet    the files to list
-     * @param parameters
-     * @return The list of files in the repository
-     * @throws NoSuchCommandScmException unless overriden by subclass
-     * @throws ScmException
+     * @see org.apache.maven.scm.provider.ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,java.util.Date,java.lang.String)
+     * @deprecated
      */
-    protected ListScmResult list( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+    public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate,
+                                   String datePattern )
         throws ScmException
     {
-        throw new NoSuchCommandScmException( "list" );
+        ScmBranch scmBranch = null;
+
+        if ( StringUtils.isNotEmpty( tag ) )
+        {
+            scmBranch = new ScmBranch( tag );
+        }
+
+        return update( repository, fileSet, scmBranch, lastUpdate, datePattern );
     }
 
     /**
-     * Calls {@link #list(ScmRepository,ScmFileSet,CommandParameters)} setting the {@link CommandParameters} with
-     * the necessary values from <code>recursive</code> and <code>tag</code>.
-     *
-     * @see #list(ScmRepository,ScmFileSet,CommandParameters)
+     * @see org.apache.maven.scm.provider.ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,ScmVersion,java.util.Date,java.lang.String)
      */
-    public ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, String tag )
+    public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion, Date lastUpdate,
+                                   String datePattern )
         throws ScmException
     {
         login( repository, fileSet );
 
         CommandParameters parameters = new CommandParameters();
 
-        parameters.setString( CommandParameter.RECURSIVE, Boolean.toString( recursive ) );
+        parameters.setScmVersion( CommandParameter.SCM_VERSION, scmVersion );
 
-        if ( StringUtils.isNotEmpty( tag ) )
+        if ( lastUpdate != null )
         {
-            parameters.setString( CommandParameter.TAG, tag );
+            parameters.setDate( CommandParameter.START_DATE, lastUpdate );
         }
 
-        return list( repository, fileSet, parameters );
+        parameters.setString( CommandParameter.CHANGELOG_DATE_PATTERN, datePattern );
+
+        parameters.setString( CommandParameter.RUN_CHANGELOG_WITH_UPDATE, "true" );
+
+        return update( repository, fileSet, parameters );
+    }
+
+    protected UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        throw new NoSuchCommandScmException( "update" );
     }
 
     // ----------------------------------------------------------------------



Mime
View raw message