tags:

views:

147

answers:

2

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.

A: 

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.

hwiechers
A: 

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.

chris.nullptr
It might help to know what kind of extension you want to write for Mercurial.
chris.nullptr
The book has a section on _using_ extensions but not one on writing them. At least, I can't find one.
hwiechers