jira-importer commented on issue #629:
URL: https://github.com/apache/maven-scm/issues/629#issuecomment-2964607836

   **[Torsten 
Förtsch](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=torsten)** 
commented
   
   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
   
   ```
   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 );
            }
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to