maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r525762 - in /maven/scm/trunk: maven-scm-api/src/main/java/org/apache/maven/scm/command/tag/ maven-scm-api/src/main/java/org/apache/maven/scm/manager/ maven-scm-api/src/main/java/org/apache/maven/scm/provider/ maven-scm-providers/maven-scm-...
Date Thu, 05 Apr 2007 08:47:29 GMT
Author: evenisse
Date: Thu Apr  5 01:47:28 2007
New Revision: 525762

URL: http://svn.apache.org/viewvc?view=rev&rev=525762
Log:
Allow to change the default tag message

Modified:
    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/manager/AbstractScmManager.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.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-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/tag/PerforceTagCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/tag/SynergyTagCommand.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/tag/AbstractCvsTagCommand.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-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java

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=525762&r1=525761&r2=525762
==============================================================================
--- 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
Thu Apr  5 01:47:28 2007
@@ -36,7 +36,7 @@
     extends AbstractCommand
 {
     protected abstract ScmResult executeTagCommand( ScmProviderRepository repository, ScmFileSet
fileSet,
-                                                    String tagName )
+                                                    String tagName, String message )
         throws ScmException;
 
     public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
@@ -45,6 +45,8 @@
     {
         String tagName = parameters.getString( CommandParameter.TAG_NAME );
 
-        return executeTagCommand( repository, fileSet, tagName );
+        String message = parameters.getString( CommandParameter.MESSAGE, "[maven-scm] copy
for tag " + tagName);
+
+        return executeTagCommand( repository, fileSet, tagName, message );
     }
 }

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java?view=diff&rev=525762&r1=525761&r2=525762
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java
(original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java
Thu Apr  5 01:47:28 2007
@@ -494,6 +494,15 @@
     /**
      *
      */
+    public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName,
String message )
+        throws ScmException
+    {
+        return this.getProviderByRepository( repository ).tag( repository, fileSet, tagName,
message );
+    }
+
+    /**
+     *
+     */
     public UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet )
         throws ScmException
     {

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java?view=diff&rev=525762&r1=525761&r2=525762
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java
(original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java
Thu Apr  5 01:47:28 2007
@@ -403,6 +403,20 @@
         throws ScmException;
 
     /**
+     * Tag (or label in some systems) will tag the source file with a certain tag
+     *
+     * @param repository the source control system
+     * @param fileSet    the files to tag. Implementations can also give the changes
+     *                   from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
+     * @param tagName    the tag name to apply to the files
+     * @param message    the commit message used for the tag creation
+     * @return
+     * @throws ScmException
+     */
+    TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, String
message )
+        throws ScmException;
+
+    /**
      * Make a file no longer editable. This is the conterpart of {@link #edit(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet)}.
      * It makes the file read-only again.
      *

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=525762&r1=525761&r2=525762
==============================================================================
--- 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
Thu Apr  5 01:47:28 2007
@@ -669,11 +669,25 @@
     public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName
)
         throws ScmException
     {
+        return tag( repository, fileSet, tagName, null );
+    }
+
+    /**
+     * @see org.apache.maven.scm.provider.ScmProvider#tag(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet,java.lang.String,java.lang.String)
+     */
+    public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName,
String message )
+        throws ScmException
+    {
         login( repository, fileSet );
 
         CommandParameters parameters = new CommandParameters();
 
         parameters.setString( CommandParameter.TAG_NAME, tagName );
+
+        if ( StringUtils.isNotEmpty( message ) )
+        {
+            parameters.setString( CommandParameter.MESSAGE, message );
+        }
 
         return tag( repository.getProviderRepository(), fileSet, parameters );
     }

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java?view=diff&rev=525762&r1=525761&r2=525762
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java
Thu Apr  5 01:47:28 2007
@@ -528,6 +528,20 @@
         throws ScmException;
 
     /**
+     * Tag (or label in some systems) will tag the source file with a certain tag
+     *
+     * @param repository the source control system
+     * @param fileSet    the files to tag. Implementations can also give the changes
+     *                   from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
+     * @param tagName    the tag name to apply to the files
+     * @param message    the commit message used for the tag creation
+     * @return
+     * @throws ScmException
+     */
+    TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, String
message )
+        throws ScmException;
+
+    /**
      * Updates the copy on the local machine with the changes in the repository
      *
      * @param repository the source control system

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommand.java?view=diff&rev=525762&r1=525761&r2=525762
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommand.java
Thu Apr  5 01:47:28 2007
@@ -41,7 +41,8 @@
     implements ClearCaseCommand
 {
 
-    protected ScmResult executeTagCommand( ScmProviderRepository scmProviderRepository, ScmFileSet
fileSet, String tag )
+    protected ScmResult executeTagCommand( ScmProviderRepository scmProviderRepository, ScmFileSet
fileSet, String tag,
+                                           String message )
         throws ScmException
     {
         getLogger().debug( "executing tag command..." );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/tag/PerforceTagCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/tag/PerforceTagCommand.java?view=diff&rev=525762&r1=525761&r2=525762
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/tag/PerforceTagCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/tag/PerforceTagCommand.java
Thu Apr  5 01:47:28 2007
@@ -51,7 +51,7 @@
 {
     private String actualRepoLocation = null;
 
-    protected ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet files,
String tag )
+    protected ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet files,
String tag, String message )
         throws ScmException
     {
         PerforceScmProviderRepository prepo = (PerforceScmProviderRepository) repo;

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagCommand.java?view=diff&rev=525762&r1=525761&r2=525762
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagCommand.java
Thu Apr  5 01:47:28 2007
@@ -45,7 +45,7 @@
     // AbstractTagCommand Implementation
     // ----------------------------------------------------------------------
 
-    protected ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet,
String tag )
+    protected ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet,
String tag, String message )
         throws ScmException
     {
 

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/tag/SynergyTagCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/tag/SynergyTagCommand.java?view=diff&rev=525762&r1=525761&r2=525762
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/tag/SynergyTagCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/tag/SynergyTagCommand.java
Thu Apr  5 01:47:28 2007
@@ -38,7 +38,8 @@
     implements SynergyCommand
 {
 
-    protected ScmResult executeTagCommand( ScmProviderRepository repository, ScmFileSet fileSet,
String tag )
+    protected ScmResult executeTagCommand( ScmProviderRepository repository, ScmFileSet fileSet,
String tag,
+                                           String message )
         throws ScmException
     {
         getLogger().debug( "executing tag command..." );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/AbstractCvsTagCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/AbstractCvsTagCommand.java?view=diff&rev=525762&r1=525761&r2=525762
==============================================================================
--- 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/tag/AbstractCvsTagCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/AbstractCvsTagCommand.java
Thu Apr  5 01:47:28 2007
@@ -39,7 +39,7 @@
     extends AbstractTagCommand
     implements CvsCommand
 {
-    public ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String
tag )
+    public ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String
tag, String message )
         throws ScmException
     {
         CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;

Modified: 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
URL: http://svn.apache.org/viewvc/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?view=diff&rev=525762&r1=525761&r2=525762
==============================================================================
--- 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
(original)
+++ 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
Thu Apr  5 01:47:28 2007
@@ -54,7 +54,7 @@
     extends AbstractTagCommand
     implements SvnCommand
 {
-    public ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String
tag )
+    public ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String
tag, String message )
         throws ScmException
     {
         if ( tag == null || StringUtils.isEmpty( tag.trim() ) )
@@ -73,8 +73,7 @@
 
         try
         {
-            // TODO: should message be customisable?
-            FileUtils.fileWrite( messageFile.getAbsolutePath(), "[maven-scm] copy for tag
" + tag );
+            FileUtils.fileWrite( messageFile.getAbsolutePath(), message );
         }
         catch ( IOException ex )
         {

Modified: maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java?view=diff&rev=525762&r1=525761&r2=525762
==============================================================================
--- maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java
(original)
+++ maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java
Thu Apr  5 01:47:28 2007
@@ -382,6 +382,15 @@
     /**
      *
      */
+    public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName,
String message )
+        throws ScmException
+    {
+        return this.getProviderByRepository( repository ).tag( repository, fileSet, tagName,
message );
+    }
+
+    /**
+     *
+     */
     public UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet )
         throws ScmException
     {

Modified: maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java?view=diff&rev=525762&r1=525761&r2=525762
==============================================================================
--- maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java
(original)
+++ maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java
Thu Apr  5 01:47:28 2007
@@ -615,6 +615,15 @@
     }
 
     /**
+     * @return getTagScmResult() always
+     */
+    public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tag, String
message )
+        throws ScmException
+    {
+        return getTagScmResult();
+    }
+
+    /**
      * @return getUpdateScmResult() always
      */
     public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag
)



Mime
View raw message