How to use mercurial (Hg) within a Python application?
Aloha!
Hg is a fine DVCS that is also a python module. This allows us to do ''import mercurial'' and load hg into our own application. My idea was to use mercurial within a Python application to create a revision controlled storage for my application.
However my google-fu semms to fail me. I can't find any开发者_运维知识库 documentation, tutorial or examples of how to use hg as a module in Python providing functionality. help(mercurial) lists the normal commands and dir() provides some hints of methods.
But do you for example create files for backing store, or do you get another type of data structure that works as a Hg repo?
There seems to be great potential for neatness having this functionality. But how?
API is mostly undocumented, and using it might require you to release your code as GPL — see https://www.mercurial-scm.org/wiki/MercurialApi. The preferred (and more backwards compatible) way is to call hg CLI frontend.
精彩评论