You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.07 23:05:24