mozversioncontrol package

Submodules

mozversioncontrol.repoupdate module

mozversioncontrol.repoupdate.update_git_repo(git, repo, path, revision=u'origin/master')

Ensure a Git repository exists at a path and is up to date.

mozversioncontrol.repoupdate.update_mercurial_repo(hg, repo, path, revision=u'default', hostfingerprints=None, global_args=None)

Ensure a HG repository exists at a path and is up to date.

Module contents

class mozversioncontrol.GitRepository(path, git=u'git')

Bases: mozversioncontrol.Repository

An implementation of Repository for Git repositories.

add_remove_files(path)
forget_add_remove_files(path)
get_added_files()
get_files_in_working_directory()
get_modified_files()
class mozversioncontrol.HgRepository(path, hg=u'hg')

Bases: mozversioncontrol.Repository

An implementation of Repository for Mercurial repositories.

add_remove_files(path)
forget_add_remove_files(path)
get_added_files()
get_files_in_working_directory()
get_modified_files()
exception mozversioncontrol.InvalidRepoPath

Bases: exceptions.Exception

Represents a failure to find a VCS repo at a specified path.

exception mozversioncontrol.MissingConfigureInfo

Bases: mozversioncontrol.MissingVCSInfo

Represents error finding VCS info from configure data.

exception mozversioncontrol.MissingVCSInfo

Bases: exceptions.Exception

Represents a general failure to resolve a VCS interface.

class mozversioncontrol.Repository(path, tool)

Bases: object

A class wrapping utility methods around version control repositories.

add_remove_files(path)

Add and remove files under path in this repository’s working copy.

forget_add_remove_files(path)

Undo the effects of a previous add_remove_files call for path.

get_added_files()

Return a list of files that are added in this repository’s working copy.

get_files_in_working_directory()

Obtain a list of managed files in the working directory.

get_modified_files()

Return a list of files that are modified in this repository’s working copy.

tool_version

Return the version of the VCS tool in use as a LooseVersion.

mozversioncontrol.get_repository_from_env()

Obtain a repository object by looking at the environment.

If inside a build environment (denoted by presence of a buildconfig module), VCS info is obtained from it, as found via configure. This allows us to respect what was passed into configure. Otherwise, we fall back to scanning the filesystem.

mozversioncontrol.get_repository_object(path)

Get a repository object for the repository at path. If path is not a known VCS repository, raise an exception.

mozversioncontrol.get_tool_path(tool)

Obtain the path of tool.