Contents:
Exception class allowing a exit_code parameter and member to be used when calling Mercurial to return exit code
A representation of a Mercurial repository
Return a config value as a boolean value. Empty values, the string ‘false’ (any capitalization), and ‘0’ are considered False, anything else True
Return a config value as a list; will try to create a list delimited by commas, or whitespace if no commas are present
Creates a branch of branch_name isn’t None If not, returns the current branch name.
Commit changes to the repository.
Get a unified diff as returned by ‘hg diff’ rev_a and rev_b are passed as -r <rev> arguments to the call, and filenames are expected to be an iterable of file names.
Returns a list of dicts where every dict has a ‘filename’ and ‘diff’ field, with diff being the complete diff for the file including header (diff -r xxxx -r xxx...).
Gets a list with the node id:s of all open heads. If short is given and is not False, return the short form of the node id
Get repositiory log.
Merge reference to current, or with ‘preview’ set to True get a list of revision numbers containing all revisions that would have been merged
Get repository status. Returns a dict containing a change char -> file list mapping, where change char is in:
A, M, R, !, ?
Example - added one.txt, modified a_folder/two.txt and three.txt:
{'A': ['one.txt'], 'M': ['a_folder/two.txt', 'three.txt'],
'!': [], '?': [], 'R': []}
If empty is set to non-False value, don’t add empty lists. If clean is set to non-False value, add clean files as well (-A)
Add one or more tags to the current revision, or revision given by passing ‘rev’ as a keyword argument:
>>> repo.hg_tag('mytag', rev=3)
Get all tags from the repo as a dict containing tag: shortnode mapping