[ https://issues.apache.org/jira/browse/SCM-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17961647#comment-17961647 ]
ASF GitHub Bot commented on SCM-460: ------------------------------------ jira-importer commented on issue #678: URL: https://github.com/apache/maven-scm/issues/678#issuecomment-2964612813 **[Olivier Lamy](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=olamy)** commented could you please provide a patch with using svn diff. Thanks > tag command ignores custom message parameter > -------------------------------------------- > > Key: SCM-460 > URL: https://issues.apache.org/jira/browse/SCM-460 > Project: Maven SCM (Moved to GitHub Issues) > Issue Type: Bug > Components: maven-scm-api > Affects Versions: 1.2 > Environment: maven-release-plugin-2.0-beta-9 > Reporter: Stas Garifulin > Assignee: Olivier Lamy > Priority: Major > Fix For: 1.3 > > > {code:title=org.apache.maven.scm.command.provider.AbstractScmProvider} > public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, > String tagName, ScmTagParameters scmTagParameters ) > throws ScmException > { > login( repository, fileSet ); > CommandParameters parameters = new CommandParameters(); > parameters.setString( CommandParameter.TAG_NAME, tagName ); > parameters.setScmTagParameters( CommandParameter.SCM_TAG_PARAMETERS, > scmTagParameters ); > return tag( repository.getProviderRepository(), fileSet, parameters ); > } > {code} > {code:title=org.apache.maven.scm.command.tag.AbstractTagCommand} > public ScmResult executeCommand( ScmProviderRepository repository, > ScmFileSet fileSet, > CommandParameters parameters ) > throws ScmException > { > String tagName = parameters.getString( CommandParameter.TAG_NAME ); > String message = parameters.getString( CommandParameter.MESSAGE, > "[maven-scm] copy for tag " + tagName ); > ScmTagParameters scmTagParameters = parameters.getScmTagParameters( > CommandParameter.SCM_TAG_PARAMETERS ); > if (message != null) > { > scmTagParameters.setMessage( message ); > } > > return executeTagCommand( repository, fileSet, tagName, > scmTagParameters ); > } > {code} > Maven release manager passes custom message to scm provider using the > scmTagParameters argument. > Scm provider passes scmTagParameters to scm tag command > (CommandParameter.SCM_TAG_PARAMETERS). > Scm tag command overrides the passed ScmTagParameters#message. > Correct implementation should be like this: > {code:title=org.apache.maven.scm.command.tag.AbstractTagCommand} > public ScmResult executeCommand( ScmProviderRepository repository, > ScmFileSet fileSet, > CommandParameters parameters ) > throws ScmException > { > String tagName = parameters.getString( CommandParameter.TAG_NAME ); > ScmTagParameters scmTagParameters = parameters.getScmTagParameters( > CommandParameter.SCM_TAG_PARAMETERS ); > String message = parameters.getString( CommandParameter.MESSAGE ); > if (message != null) > { > // if message was passed by CommandParameter.MESSAGE then use it. > scmTagParameters.setMessage( message ); > } > if(scmTagParameters.getMessage() == null) > { > // if message hasn't been passed nor by ScmTagParameters nor by > CommandParameter.MESSAGE then use default. > scmTagParameters.setMessage( "[maven-scm] copy for tag " + > tagName ); > } > return executeTagCommand( repository, fileSet, tagName, > scmTagParameters ); > } > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)