在 TortoiseHg UI 中引发消息对话框
我编写了一个在命令行中运行良好的提交钩子:
example.py
def saysomething(ui, repo, **kwargs):
ui.status('today is 26-May')
我已将存储库的 .hg\hgrc 文件配置为包括:
[hooks]
commit = python:/path/to/example.py:saysomething
当我从命令行提交时,正如预期的那样,我得到的输出是“今天是 5 月 26 日”。
但我无法说服 TortoiseHg GUI 在提交时显示消息。我在 python 脚本中使用了错误的语法吗?我是否需要在存储库的 hgrc 之外的某些配置文件中添加挂钩?我还尝试将钩子添加到全局 .hgrc 文件中,但这没有帮助,而且无论如何这对我的问题来说都是一个糟糕的解决方案。
我浏览了HG 编写钩子指南,编写扩展的指南和 TortoiseHg 指南,我没有在任何地方看到有关如何执行此操作的解释。
在 Windows XP 上使用 TortoiseHg 2.0.4,包括 Mercurial 1.8。
I've written a commit hook that is working just fine from the command line:
example.py
def saysomething(ui, repo, **kwargs):
ui.status('today is 26-May')
I've configured my repository's .hg\hgrc file to include:
[hooks]
commit = python:/path/to/example.py:saysomething
And when I commit from the command line, I get the output "today is 26-May", as expected.
But I cannot convince the TortoiseHg GUI to display the message on committing. Am I using the wrong syntax in my python script? Do I need to add the hook in some configuration file other than the repository's hgrc? I also tried adding the hook to the global .hgrc file, but this didn't help, and it would have been a bad solution to my problem anyhow.
I've looked through the HG guide on writing hooks, the guide on writing extensions, and the TortoiseHg guide, and I don't see an explanation anywhere on how to do this.
Using TortoiseHg 2.0.4, including Mercurial 1.8, on Windows XP.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论