vcs_support

vcs_support.base

class vcs_support.base.BaseCLI

Helper class for CLI-heavy classes.

run(*args)
Parameters:bits – list of command and args. See subprocess docs
class vcs_support.base.BaseContributionBackend(repo)

Base class for contribution backends.

The main purpose of this base class is to define the API.

classmethod accepts(url)

Classmethod that checks if a given repository URL is supported by this backend.

get_branch_file(branch, filename)

Returns the contents of a file as it is in the specified branch.

push_branch(branch, title='', comment='')

Pushes a branch upstream.

set_branch_file(branch, filename, contents, comment='')

Saves the file in the specified branch.

class vcs_support.base.BaseVCS(project, version, **kwargs)

Base for VCS Classes. Built on top of the BaseCLI.

branches

Returns a list of VCSVersion objects. See VCSVersion for more information.

checkout(identifier=None)

Set the state to the given identifier.

If identifier is None, checkout to the latest revision.

The type and format of identifier may change from VCS to VCS, so each backend is responsible to understand it’s identifiers.

commit

Returns a string representing the current commit.

get_contribution_backend()

Returns a contribution backend or None for this repository. The backend is detected via the repository URL.

make_clean_working_dir()

Ensures that the working dir exists and is empty

tags

Returns a list of VCSVersion objects. See VCSVersion for more information.

update()

If self.working_dir is already a valid local copy of the repository, update the repository, else create a new local copy of the repository.

class vcs_support.base.VCSProject

Transient object to encapsulate a projects stuff

class vcs_support.base.VCSVersion(repository, identifier, verbose_name)

Represents a Version (tag or branch) in a VCS.

This class should only be instantiated in BaseVCS subclasses.

It can act as a context manager to temporarily switch to this tag (eg to build docs for this tag).