How to use mercury (Hg) in a Python application?

Aloha!

Hg is a great DVCS, which is also a python module. This allows us to "import mercurial" and load hg into our own application. My idea was to use the mercurial application in a Python application to create a version controlled repository for my application.

However, my google-fu semms didn't let me down. I cannot find documentation, a tutorial, or examples of using hg as a module in Python that provides functionality. help (mercurial) lists ordinary commands, and dir () provides some method hints.

But you, for example, create files for backup storage or get a different type of data structure that works as a Hg rep?

There seems to be great potential for neatness with this functionality. But how?

+7
source share
1 answer

The API is mostly undocumented, and to use it you may need to cancel your code as a GPL - see https://www.mercurial-scm.org/wiki/MercurialApi . A preferred (and more inverse) way is to invoke the hg CLI.

+6
source

All Articles