module documentation
Utilities for interacting with cgit.
Class |
|
Test case that requires git for compatibility checks. |
Function | check |
Check for a running TCP daemon. |
Function | git |
Attempt to determine the version of git currently installed. |
Function | import |
Import a repo from a fast-export file in a temporary directory. |
Function | remove |
Undocumented |
Function | require |
Require git version >= version, or skip the calling test. |
Function | run |
Run a git command. |
Function | run |
Run a git command, capture stdout/stderr, and fail if git fails. |
Variable | rmtree |
Undocumented |
Constant | _DEFAULT |
Undocumented |
Constant | _REPOS |
Undocumented |
Constant | _VERSION |
Undocumented |
Check for a running TCP daemon.
Defaults to checking 10 times with a delay of 0.1 sec between tries.
- Returns: A boolean, true if a daemon is running on the specified port,
- false if not.
Parameters | |
limit | Number of attempts before deciding no daemon is running. |
delay | Delay between connection attempts. |
timeout | Socket timeout for connection attempts. |
port | Port on which we expect the daemon to appear. |
Attempt to determine the version of git currently installed.
- Returns: A tuple of ints of the form (major, minor, point, sub-point), or
- None if no git installation was found.
Parameters | |
git | Path to the git executable; defaults to the version in the system path. |
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.
Returns: The path to the imported repository.
Parameters | |
name | The name of the repository export file, relative to dulwich/tests/data/repos. |
Require git version >= version, or skip the calling test.
Parameters | |
required | A tuple of ints of the form (major, minor, point, sub-point); omitted components default to 0. |
git | Path to the git executable; defaults to the version in the system path. |
Raises | |
ValueError | if the required version tuple has too many parts. |
SkipTest | if no suitable git version was found at the given path. |
def run_git(args, git_path=_DEFAULT_GIT, input=None, capture_stdout=False, capture_stderr=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.
- Returns: A tuple of (returncode, stdout contents, stderr contents).
- If capture_stdout is False, None will be returned as stdout contents. If capture_stderr is False, None will be returned as stderr contents.
Parameters | |
args | A list of args to the git command. |
git | Path to to the git executable. |
input | Input data to be sent to stdin. |
capture | Whether to capture and return stdout. |
capture | Undocumented |
**popen | Additional kwargs for subprocess.Popen; stdin/stdout args are ignored. |
Raises | |
OSError | if the git executable was not found. |
_REPOS_DATA_DIR =
¶
Undocumented
Value |
|