[ 
http://jira.codehaus.org/browse/SCM-406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=155632#action_155632
 ] 

Torsten Juergeleit commented on SCM-406:
----------------------------------------

George,

you're right. Hard-coding the update to trunk like the patch in SCM-262 doesn't 
fly.

So how about the workaround suggested by Alison Winters to do "svn update" 
prior to the "svn copy" in ScmTagPhase?
Maybe something like
{code}
Index: src/main/java/org/apache/maven/shared/release/phase/ScmTagPhase.java
===================================================================
--- src/main/java/org/apache/maven/shared/release/phase/ScmTagPhase.java        
(revision 720901)
+++ src/main/java/org/apache/maven/shared/release/phase/ScmTagPhase.java        
(working copy)
@@ -61,8 +61,6 @@
 
         validateConfiguration( releaseDescriptor );
 
-        logInfo( relResult, "Tagging release with the label " + 
releaseDescriptor.getScmReleaseLabel() + "..." );
-
         ScmRepository repository;
         ScmProvider provider;
         try
@@ -80,12 +78,35 @@
             throw new ReleaseExecutionException( "Unable to configure SCM 
repository: " + e.getMessage(), e );
         }
 
+       // TODO: want includes/excludes?
+        ScmFileSet fileSet = new ScmFileSet( new File( 
releaseDescriptor.getWorkingDirectory() ) );
+        
+        // Due to a Subversion bug 
http://subversion.tigris.org/servlets/BrowseList?list=users&by=thread&from=686753
+        // regarding the tag command (svn copy) we need to update the working 
directory first! 
+        if ("svn".equals(provider.getScmType()))
+        {
+               UpdateScmResult result;
+               try
+               {
+               logInfo( relResult, "Due to a Subversion bug we have to update 
the working directory before tagging ..." );
+               result = provider.update( repository, fileSet );
+               }
+               catch ( ScmException e )
+               {
+                   throw new ReleaseExecutionException( "An error is occurred 
while updating working directory: " + e.getMessage(), e );
+               }
+       
+               if ( !result.isSuccess() )
+               {
+                   throw new ReleaseScmCommandException( "Unable to update 
working directory", result );
+               }
+        }
+        
         TagScmResult result;
         try
         {
-            // TODO: want includes/excludes?
-            ScmFileSet fileSet = new ScmFileSet( new File( 
releaseDescriptor.getWorkingDirectory() ) );
             String tagName = releaseDescriptor.getScmReleaseLabel();
+            logInfo( relResult, "Tagging release with the label " + tagName + 
"..." );
             result = provider.tag( repository, fileSet, tagName,
                                    releaseDescriptor.getScmCommentPrefix() + " 
copy for tag " + tagName );
         }
{code}

> scm tag does not work with Subversion 1.5.1
> -------------------------------------------
>
>                 Key: SCM-406
>                 URL: http://jira.codehaus.org/browse/SCM-406
>             Project: Maven SCM
>          Issue Type: Bug
>          Components: maven-scm-provider-svn
>    Affects Versions: 1.0
>            Reporter: James William Dumay
>             Fix For: 1.1.1
>
>
> scm:checkin does not work with Subversion 1.5.1
> On release:perform (which I assume calls scm:checkin) the following error 
> occurs:
> {code}
> svn: File 
> '/svn/private/atlassian/confluence/tags/confluence-project-2.10-m1/conf-acceptance-test/pom.xml'
>  already exists
> {code}
> Using subversion 1.4.x is a good enough workaround.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to