Utilities for interacting with cgit.
Function git_version Attempt to determine the version of git currently installed.
Function require_git_version Require git version >= version, or skip the calling test.
Function run_git Run a git command.
Function run_git_or_fail Run a git command, capture stdout/stderr, and fail if git fails.
Function import_repo_to_dir Import a repo from a fast-export file in a temporary directory.
Function check_for_daemon Check for a running TCP daemon.
Class CompatTestCase Test case that requires git for compatibility checks.
Function remove_ro Undocumented
def git_version(git_path=_DEFAULT_GIT):
Attempt to determine the version of git currently installed.
Parametersgit_pathPath to the git executable; defaults to the version in the system path.
ReturnsA tuple of ints of the form (major, minor, point, sub-point), or None if no git installation was found.
def require_git_version(required_version, git_path=_DEFAULT_GIT):
Require git version >= version, or skip the calling test.
Parametersrequired_versionA tuple of ints of the form (major, minor, point, sub-point); ommitted components default to 0.
git_pathPath to the git executable; defaults to the version in the system path.
RaisesValueErrorif the required version tuple has too many parts.
SkipTestif no suitable git version was found at the given path.
def run_git(args, git_path=_DEFAULT_GIT, input=None, capture_stdout=False, **popen_kwargs):

Run a git command.

Input is piped from the input parameter and output is sent to the standard streams, unless capture_stdout is set.

ParametersargsA list of args to the git command.
git_pathPath to to the git executable.
inputInput data to be sent to stdin.
capture_stdoutWhether to capture and return stdout.
popen_kwargsAdditional kwargs for subprocess.Popen; stdin/stdout args are ignored.
ReturnsA tuple of (returncode, stdout contents). If capture_stdout is False, None will be returned as stdout contents.
RaisesOSErrorif the git executable was not found.
def run_git_or_fail(args, git_path=_DEFAULT_GIT, input=None, **popen_kwargs):
Run a git command, capture stdout/stderr, and fail if git fails.
def import_repo_to_dir(name):

Import a repo from a fast-export file in a temporary directory.

These are used rather than binary repos for compat tests because they are more compact and human-editable, and we already depend on git.

ParametersnameThe name of the repository export file, relative to dulwich/tests/data/repos.
ReturnsThe path to the imported repository.
def check_for_daemon(limit=10, delay=0.1, timeout=0.1, port=TCP_GIT_PORT):

Check for a running TCP daemon.

Defaults to checking 10 times with a delay of 0.1 sec between tries.

ParameterslimitNumber of attempts before deciding no daemon is running.
delayDelay between connection attempts.
timeoutSocket timeout for connection attempts.
portPort on which we expect the daemon to appear.
ReturnsA boolean, true if a daemon is running on the specified port, false if not.
def remove_ro(action, name, exc):
Undocumented
API Documentation for Dulwich, generated by pydoctor at 2018-11-17 19:05:54.