Using with Mercurial (hg) (paver.hg)

Convenience functions for working with mercurial

This module does not include any tasks, only functions.

At this point, these functions do not use any kind of library. They require the hg binary on the PATH.

paver.hg.branches(repo_path, closed=False)

List branches for the target repository.

Parameters:

repo_path (string): The local path to a mercurial repository. closed=False (bool): Whether to include closed branches in the

branch list.
Returns:
A python tuple. The first item of the tuple is the current branch. The second item of the tuple is a list of the branches
paver.hg.clone(url, dest_folder, rev=None)

Clone a mercurial repository.

Parameters:
url (string): The path to clone the repository from. Could be local
or remote.
dest_folder (string): The local folder where the repository will be
cloned.
rev=None (string or None): If specified, the revision to clone to.
If omitted or None, all changes will be cloned.
Returns:
None
paver.hg.latest_tag(repo_path, relative_to='tip')

Get the latest tag from a mercurial repository.

Parameters:

repo_path (string): The local path to a mercurial repository. relative_to=’tip’ (string): If provided, the revision to use as

a reference. Defaults to ‘tip’.
Returns:
The string name of the latest tag.
paver.hg.pull(repo_path, rev=None, url=None)

Pull changes into a mercurial repository.

Parameters:

repo_path (string): The local path to a mercurial repository. rev=None (string or None): If specified, the revision to pull to.

If omitted or None, all changes will be pulled.
url=None (string or None): If specified, the repository to pull from.
If omitted or None, the default location of the repository will be used.
Returns:
None
paver.hg.update(repo_path, rev='tip', clean=False)

Update a mercurial repository to a revision.

Parameters:

repo_path (string): The local path to a mercurial repository. rev=’tip’ (string): If provided, the revision to update to. If

omitted, ‘tip’ will be used.
clean=False (bool): If True, the update will discard uncommitted
changes.
Returns:
None