我们正在从 HG 迁移到 Rhodecode,并且我们正在使用自定义 buildbot 挂钩来构建推送事件。正如这里提到的,在 Rhodecode 中添加自定义的 mercurial 钩子很简单。ui.config
问题是我们正在从 rc 扩展文件通过in 钩子读取配置,例如凭据
def hook(ui, repo, hooktype, node=None, source=None, **kwargs):
username = ui.config('hgbuildbot', 'user', '')
password = ui.config('hgbuildbot', 'passwd', '')
rc 扩展文件位于:
/etc/mercurial-server/remote-hgrc.d/buildbot.rc
[hgbuildbot]
user = username
passwd = secret-password
有了这些设置,mercurial 调用这个钩子并通过ui.config
我们获取凭据,我们如何在 Rhodecode 中做同样的事情:如何从 rc 扩展文件中读取配置?