mozharness.base.vcs package

Submodules

mozharness.base.vcs.gittool module

class mozharness.base.vcs.gittool.GittoolParser(config=None, log_obj=None, error_list=None, log_output=True)[source]

Bases: mozharness.base.log.OutputParser

A class that extends OutputParser such that it can find the “Got revision” string from gittool.py output

got_revision = None
got_revision_exp = <_sre.SRE_Pattern object>
parse_single_line(line)[source]
class mozharness.base.vcs.gittool.GittoolVCS(log_obj=None, config=None, vcs_config=None, script_obj=None)[source]

Bases: mozharness.base.script.ScriptMixin, mozharness.base.log.LogMixin

ensure_repo_and_revision()[source]

Makes sure that dest is has revision or branch checked out from repo.

Do what it takes to make that happen, including possibly clobbering dest.

mozharness.base.vcs.hgtool module

class mozharness.base.vcs.hgtool.HgtoolParser(config=None, log_obj=None, error_list=None, log_output=True)[source]

Bases: mozharness.base.log.OutputParser

A class that extends OutputParser such that it can find the “Got revision” string from hgtool.py output

got_revision = None
got_revision_exp = <_sre.SRE_Pattern object>
parse_single_line(line)[source]
class mozharness.base.vcs.hgtool.HgtoolVCS(log_obj=None, config=None, vcs_config=None, script_obj=None)[source]

Bases: mozharness.base.script.ScriptMixin, mozharness.base.log.LogMixin

ensure_repo_and_revision()[source]

Makes sure that dest is has revision or branch checked out from repo.

Do what it takes to make that happen, including possibly clobbering dest.

mozharness.base.vcs.mercurial module

Mercurial VCS support.

Largely copied/ported from https://hg.mozilla.org/build/tools/file/cf265ea8fb5e/lib/python/util/hg.py .

class mozharness.base.vcs.mercurial.MercurialVCS(log_obj=None, config=None, vcs_config=None, script_obj=None)[source]

Bases: mozharness.base.script.ScriptMixin, mozharness.base.log.LogMixin, object

apply_and_push(localrepo, remote, changer, max_attempts=10, ssh_username=None, ssh_key=None)[source]

This function calls `changer’ to make changes to the repo, and tries its hardest to get them to the origin repo. `changer’ must be a callable object that receives two arguments: the directory of the local repository, and the attempt number. This function will push ALL changesets missing from remote.

cleanOutgoingRevs(reponame, remote, username, sshKey)[source]
clone(repo, dest, branch=None, revision=None, update_dest=True)[source]

Clones hg repo and places it at dest, replacing whatever else is there. The working copy will be empty.

If revision is set, only the specified revision and its ancestors will be cloned. If revision is set, branch is ignored.

If update_dest is set, then dest will be updated to revision if set, otherwise to branch, otherwise to the head of default.

common_args(revision=None, branch=None, ssh_username=None, ssh_key=None)[source]

Fill in common hg arguments, encapsulating logic checks that depend on mercurial versions and provided arguments

ensure_repo_and_revision()[source]

Makes sure that dest is has revision or branch checked out from repo.

Do what it takes to make that happen, including possibly clobbering dest.

get_branch_from_path(path)[source]
get_branches_from_path(path)[source]
get_repo_name(repo)[source]
get_repo_path(repo)[source]
get_revision_from_path(path)[source]

Returns which revision directory path currently has checked out.

hg_ver()[source]

Returns the current version of hg, as a tuple of (major, minor, build)

out(src, remote, **kwargs)[source]

Check for outgoing changesets present in a repo

pull(repo, dest, update_dest=True, **kwargs)[source]

Pulls changes from hg repo and places it in dest.

If revision is set, only the specified revision and its ancestors will be pulled.

If update_dest is set, then dest will be updated to revision if set, otherwise to branch, otherwise to the head of default.

push(src, remote, push_new_branches=True, **kwargs)[source]
query_can_share()[source]
share(source, dest, branch=None, revision=None)[source]

Creates a new working directory in “dest” that shares history with “source” using Mercurial’s share extension

update(dest, branch=None, revision=None)[source]

Updates working copy dest to branch or revision. If revision is set, branch will be ignored. If neither is set then the working copy will be updated to the latest revision on the current branch. Local changes will be discarded.

mozharness.base.vcs.mercurial.make_hg_url(hg_host, repo_path, protocol='http', revision=None, filename=None)[source]

Helper function.

Construct a valid hg url from a base hg url (hg.mozilla.org), repo_path, revision and possible filename

mozharness.base.vcs.vcsbase module

Generic VCS support.

class mozharness.base.vcs.vcsbase.MercurialScript(**kwargs)[source]

Bases: mozharness.base.vcs.vcsbase.VCSScript

default_vcs = 'hg'
class mozharness.base.vcs.vcsbase.VCSMixin[source]

Bases: object

Basic VCS methods that are vcs-agnostic. The vcs_class handles all the vcs-specific tasks.

query_dest(kwargs)[source]
vcs_checkout(vcs=None, error_level='fatal', **kwargs)[source]

Check out a single repo.

vcs_checkout_repos(repo_list, parent_dir=None, tag_override=None, **kwargs)[source]

Check out a list of repos.

class mozharness.base.vcs.vcsbase.VCSScript(**kwargs)[source]

Bases: mozharness.base.vcs.vcsbase.VCSMixin, mozharness.base.script.BaseScript

pull(repos=None, parent_dir=None)[source]

mozharness.base.vcs.vcssync module

Generic VCS support.

class mozharness.base.vcs.vcssync.VCSSyncScript(**kwargs)[source]

Bases: mozharness.base.vcs.vcsbase.VCSScript

notify(message=None, fatal=False)[source]

Email people in the notify_config (depending on status and failure_only)

start_time = 1440001632.71014

Module contents