Mercurial API 和扩展资源
我想为 Mercurial 编写扩展。什么是好的资源,例如教程、指南、API 参考,甚至是评论良好且易于从源代码获取的现有扩展。
到目前为止,我只找到了简短的 MercurialApi 和 WritingExtensions wiki 页面。
I want to write extensions for Mercurial. What are good resources such as tutorials, guides, API reference or maybe even a existing extension that is well commented and easy to lean from the source.
So far, I have only found the short MercurialApi and WritingExtensions wiki pages.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(2)
Mercurial 权威指南,也称为 hg 书,包含有关为 Mercurial 编写扩展的部分。该书可在 http://hgbook.red-bean.com/ 上免费查看。
编辑:我很抱歉,hg 书只描述了使用扩展而不是编写它们。不过,书中关于编写钩子的部分可能仍然有用。
学习如何编写扩展的最佳方法可能是阅读扩展代码。将大部分注意力集中在执行与您想要实现的功能类似的功能的扩展上。
例如,如果您有兴趣从一种 SCM 系统转换为另一种,请查看 hg-git 扩展名。
Mercurial The Definitive Guide, also known as the hg book, contains a section on writing extensions for Mercurial. The book is available to view for free at http://hgbook.red-bean.com/.
Edit: My apologies, the hg book did only describe using extensions not writing them. The section on writing hooks in the book may still be useful though.
The best way to learn how to write an extension is probably going to be reading extension code. Focus the most attention on extensions that perform functions similar to what you want to implement.
e.g. If your interested in converting from one SCM system to another take a look at the hg-git extension.
据我所知,用于编写扩展的“学习材料”并不多。您最好的选择可能是找到一个与您想要编写的扩展类似的扩展,阅读源代码并弄清楚它是如何工作的。如果您遇到困难,可以尝试联系该扩展程序的作者。
As far as I know, there isn't a lot in the way of 'learning materials' for writing extensions. Your best bet is probably to find an extension that does something similar to the one you want to write, read the source and figure out how it works. You can try contacting that extension's author if you get stuck.