简体   繁体   English

SVN提交后挂钩:使用SET命令参数化电子邮件地址时出现错误255

[英]SVN Post-commit hook: error 255 when parameterizing email address using SET command

We use the SVN Post-Commit hook to send email notifications when SVN revisions have been submitted to the repository. 当SVN修订版已提交到存储库时,我们使用SVN Post-Commit钩子发送电子邮件通知。 I am attempting to create email distribution lists so SVN users can pick which emails are sent to them based on the URL for the file that was committed to the repo. 我正在尝试创建电子邮件通讯组列表,以便SVN用户可以根据已提交到回购文件的文件的URL选择发送给他们的电子邮件。

When I commit changes to the repo and the hook script fires, I get the following error: 当我将更改提交到存储库并触发钩子脚本时,出现以下错误:

Completed: At revision: 8494 Error: post-commit hook failed (exit code 255) with output: Error: @domain.com was unexpected at this time. 已完成:在修订版:8494错误:提交后挂钩失败(退出代码255),输出:错误:@ domain.com此时是意外的。

I have unsuccessfully attempted to use escape characters ' ^ ',' \\ ' to escape the ' @ ', ' . 我尝试使用转义字符' ^ ',' \\ '来转义' @ ','未成功 ' and ' ; '和' ; ' characters in the two variables described below. '字符在下面描述的两个变量中。

Can anyone suggest how, if at all, I can properly format the values of the two variables below to pass them to the VisualSVNServerHook call? 谁能建议(如果有的话)如何正确格式化下面两个变量的值,以将它们传递给VisualSVNServerHook调用? Thank you! 谢谢!


set "distroDBA=joe@domain.com;"
set "distroAll=joe@domain.com; sally@domain.com;"

//IF DBA Revision
"%VISUALSVN_SERVER%\bin\VisualSVNServerHooks.exe" ^
commit-notification "%1" -r %2 ^
--from $(author)@domain.com --to "%distroDBA%" ^
--smtp-server smtp.domain.com

//ALL Other Revision
"%VISUALSVN_SERVER%\bin\VisualSVNServerHooks.exe" ^
commit-notification "%1" -r %2 ^
--from $(author)@domain.com --to "%distroAll%" ^
--smtp-server smtp.domain.com

I haven't ran this hook script. 我还没有运行这个钩子脚本。 However, I've just noticed a couple of problems: 但是,我刚刚注意到了两个问题:

set "distroAll=joe@domain.com; sally@domain.com;"

Remove whitespace after semicolon and remote the last whitespace, too. 在分号后删除空格,并也远程删除最后一个空格。 And it seems that quote signs are unnecessary for your SET statements. 似乎您的SET语句不需要引号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM