Mercurial远程服务器changegroup.notify钩子触发异常排查
Mercurial 6.3.1 changegroup.notify钩子报错修复方案
问题描述
将Mercurial从2.7版本升级到6.3.1版本(搭配Python 3.9)后,推送变更至远程仓库时,changegroup.notify钩子触发报错,错误信息为:
int() argument must be a string, a bytes-like object or a number, not 'NoneType'
原仓库仅在hgrc中配置了:
changegroup.notify = python:hgext.notify.hook
解决方法
通过本地测试回溯排查,发现新版本Mercurial需要显式启用notify扩展,并补充完整的邮件相关配置。修改后的完整hgrc配置如下:
[extensions] notify= [hooks] changegroup.notify = python:hgext.notify.hook [reposubs] * = [服务器邮箱] [email] from = Mercurial Notification <noreply@mydomain> [smtp] host = localhost
修改配置后重新推送,钩子即可正常运行。
内容的提问来源于stack exchange,提问作者HST
相关产品推荐
相关产品推荐

