OpenQuizz
Une application de gestion des contenus pédagogiques
Git Class Reference
Inheritance diagram for Git:
Collaboration diagram for Git:

Public Member Functions

def is_immutable_rev_checkout (self, url, dest)
 
def get_git_version (self)
 
def get_current_branch (cls, location)
 
def get_revision_sha (cls, dest, rev)
 
def resolve_revision (cls, dest, url, rev_options)
 
def is_commit_id_equal (cls, dest, name)
 
def fetch_new (self, dest, url, rev_options)
 
def switch (self, dest, url, rev_options)
 
def update (self, dest, url, rev_options)
 
def get_remote_url (cls, location)
 
def has_commit (cls, location, rev)
 
def get_revision (cls, location, rev=None)
 
def get_subdirectory (cls, location)
 
def get_url_rev_and_auth (cls, url)
 
def update_submodules (cls, location)
 
def get_repository_root (cls, location)
 
- Public Member Functions inherited from VersionControl
def should_add_vcs_url_prefix (cls, remote_url)
 
def get_requirement_revision (cls, repo_dir)
 
def get_src_requirement (cls, repo_dir, project_name)
 
def make_rev_options (cls, rev=None, extra_args=None)
 
def get_netloc_and_auth (cls, netloc, scheme)
 
def get_url_rev_options (self, url)
 
def compare_urls (cls, url1, url2)
 
def obtain (self, dest, url)
 
def unpack (self, location, url)
 
def get_revision (cls, location)
 
def run_command (cls, cmd, show_stdout=True, cwd=None, on_returncode='raise', extra_ok_returncodes=None, command_desc=None, extra_environ=None, spinner=None, log_failed_cmd=True, stdout_only=False)
 
def is_repository_directory (cls, path)
 

Static Public Member Functions

def get_base_rev_args (rev)
 
- Static Public Member Functions inherited from VersionControl
def make_rev_args (username, password)
 
def normalize_url (url)
 

Static Public Attributes

 name
 
 dirname
 
 repo_name
 
 schemes
 
 unset_environ
 
 default_arg_rev
 
- Static Public Attributes inherited from VersionControl
 name
 
 dirname
 
 repo_name
 
 schemes
 
 unset_environ
 
 default_arg_rev
 

Member Function Documentation

◆ fetch_new()

def fetch_new (   self,
  dest,
  url,
  rev_options 
)
Fetch a revision from a repository, in the case that this is the
first fetch from the repository.

Args:
  dest: the directory to fetch the repository to.
  rev_options: a RevOptions object.

Reimplemented from VersionControl.

◆ get_base_rev_args()

def get_base_rev_args (   rev)
static
Return the base revision arguments for a vcs command.

Args:
  rev: the name of a revision to install.  Cannot be None.

Reimplemented from VersionControl.

◆ get_current_branch()

def get_current_branch (   cls,
  location 
)
Return the current branch, or None if HEAD isn't at a branch
(e.g. detached HEAD).

◆ get_git_version()

def get_git_version (   self)

◆ get_remote_url()

def get_remote_url (   cls,
  location 
)
Return URL of the first remote encountered.

Raises RemoteNotFoundError if the repository does not have a remote
url configured.

Reimplemented from VersionControl.

◆ get_repository_root()

def get_repository_root (   cls,
  location 
)
Return the "root" (top-level) directory controlled by the vcs,
or `None` if the directory is not in any.

It is meant to be overridden to implement smarter detection
mechanisms for specific vcs.

This can do more than is_repository_directory() alone. For
example, the Git override checks that Git is actually available.

Reimplemented from VersionControl.

◆ get_revision()

def get_revision (   cls,
  location,
  rev = None 
)

◆ get_revision_sha()

def get_revision_sha (   cls,
  dest,
  rev 
)
Return (sha_or_none, is_branch), where sha_or_none is a commit hash
if the revision names a remote branch or tag, otherwise None.

Args:
  dest: the repository directory.
  rev: the revision name.

◆ get_subdirectory()

def get_subdirectory (   cls,
  location 
)
Return the path to setup.py, relative to the repo root.
Return None if setup.py is in the repo root.

Reimplemented from VersionControl.

◆ get_url_rev_and_auth()

def get_url_rev_and_auth (   cls,
  url 
)
Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'.
That's required because although they use SSH they sometimes don't
work with a ssh:// scheme (e.g. GitHub). But we need a scheme for
parsing. Hence we remove it again afterwards and return it as a stub.

Reimplemented from VersionControl.

◆ has_commit()

def has_commit (   cls,
  location,
  rev 
)
Check if rev is a commit that is available in the local repository.

◆ is_commit_id_equal()

def is_commit_id_equal (   cls,
  dest,
  name 
)
Return whether the current commit hash equals the given name.

Args:
  dest: the repository directory.
  name: a string name.

Reimplemented from VersionControl.

◆ is_immutable_rev_checkout()

def is_immutable_rev_checkout (   self,
  url,
  dest 
)
Return true if the commit hash checked out at dest matches
the revision in url.

Always return False, if the VCS does not support immutable commit
hashes.

This method does not check if there are local uncommitted changes
in dest after checkout, as pip currently has no use case for that.

Reimplemented from VersionControl.

◆ resolve_revision()

def resolve_revision (   cls,
  dest,
  url,
  rev_options 
)
Resolve a revision to a new RevOptions object with the SHA1 of the
branch, tag, or ref if found.

Args:
  rev_options: a RevOptions object.

◆ switch()

def switch (   self,
  dest,
  url,
  rev_options 
)
Switch the repo at ``dest`` to point to ``URL``.

Args:
  rev_options: a RevOptions object.

Reimplemented from VersionControl.

◆ update()

def update (   self,
  dest,
  url,
  rev_options 
)
Update an already-existing repo to the given ``rev_options``.

Args:
  rev_options: a RevOptions object.

Reimplemented from VersionControl.

◆ update_submodules()

def update_submodules (   cls,
  location 
)

Field Documentation

◆ default_arg_rev

default_arg_rev
static

◆ dirname

dirname
static

◆ name

name
static

◆ repo_name

repo_name
static

◆ schemes

schemes
static

◆ unset_environ

unset_environ
static

The documentation for this class was generated from the following file: