fabtools.require.mercurial¶
Mercurial¶
This module provides high-level tools for managing Mercurial repositories.
See also
-
fabtools.require.mercurial.command()[source]¶ Require the
hgcommand-line tool.Example:
from fabric.api import run from fabtools import require require.mercurial.command() run('hg --help')
-
fabtools.require.mercurial.working_copy(remote_url, path=None, branch='default', update=True, use_sudo=False, user=None)[source]¶ Require a working copy of the repository from the
remote_url.The
pathis optional, and defaults to the last segment of the remote repository URL.If the
pathdoes not exist, this will clone the remote repository and check out the specified branch.If the
pathexists andupdateisTrue, it will pull changes from the remote repository, check out the specified branch, then update the working copy.If the
pathexists andupdateisFalse, it will only check out the specified branch, without pulling remote changesets.Parameters: - remote_url (str) – URL of the remote repository
- path (str) – Absolute or relative path of the working copy on the
filesystem. If this directory doesn’t exist yet, a new
working copy is created through
hg clone. If the directory does exist andupdate == True, ahg pull && hg upis issued. Ifpath is Nonethehg cloneis issued in the current working directory and the directory name of the working copy is created byhg. - branch (str) – Branch or tag to check out. If the given value is a tag
name, update must be
Falseor consecutive calls will fail. - update (bool) – Whether or not to pull and update remote changesets.
- use_sudo (bool) – If
Trueexecutehgwithfabric.operations.sudo(), else withfabric.operations.run(). - user (str) – If
use_sudo is True, runfabric.operations.sudo()with the given user. Ifuse_sudo is Falsethis parameter has no effect.