readthedocs.vcs_support

readthedocs.vcs_support.base

Base classes for VCS backends.

class readthedocs.vcs_support.base.BaseVCS(project, version_slug, environment=None, **kwargs)

Base for VCS Classes.

VCS commands are ran inside a LocalEnvironment.

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.

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()

Update a local copy of the repository in self.working_dir.

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 readthedocs.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).