southwark
Extensions to the Dulwich Git library.
Classes:
|
Represents the output of |
The values are lists of filenames, relative to the repository root. |
Data:
Invariant |
Functions:
|
Returns |
|
Check the |
|
Clone a local or remote git repository. |
|
Returns a mapping of commit SHAs to tags. |
|
Return add/delete/modify changes to tree by comparing the index to HEAD. |
|
Returns a list of untracked files. |
|
Returns a context manager which will return |
|
Returns staged, unstaged, and untracked changes relative to the HEAD. |
Contextmanager to aid cloning on Windows during tests. |
-
namedtuple
GitStatus(staged, unstaged, untracked)[source] Bases:
NamedTupleRepresents the output of
status().New in version 0.6.1.
- Fields
staged (
StagedDict) – Dict with lists of staged paths.untracked (
List[PathPlus]) – List of untracked, un-ignored & non-.git paths.
-
__repr__() Return a nicely formatted representation string
-
typeddict
StagedDict[source] Bases:
TypedDictThe values are lists of filenames, relative to the repository root.
New in version 0.6.1.
-
assert_clean(repo, allow_config=())[source] Returns
Trueif the working directory is clean.If not, returns
Falseand prints a helpful error message to stderr.
-
clone(source, target=None, bare=False, checkout=None, errstream=<_io.BufferedWriter name='<stderr>'>, origin='origin', depth=None, **kwargs)[source] Clone a local or remote git repository.
- Parameters
source (
Union[str,bytes]) – Path or URL for source repository.target (
Union[str,Path,PathLike,bytes,None]) – Path to target repository. DefaultNone.bare (
bool) – Whether to create a bare repository. DefaultFalse.checkout (
Optional[bool]) – Whether to check-out HEAD after cloning. DefaultNone.errstream (
IO) – Optional stream to write progress to. Default<_io.BufferedWriter name='<stderr>'>.origin (
Union[str,bytes]) – Name of remote from the repository used to clone. Default'origin'.
- Return type
- Returns
The cloned repository.
New in version 0.6.1.
Changed in version 0.7.2:targetnow acceptsdomdf_python_tools.typing.PathLikeobjects.originnow acceptsstrobjects.
-
get_tree_changes(repo)[source] Return add/delete/modify changes to tree by comparing the index to HEAD.
- Parameters
repo (
Union[str,Path,PathLike,Repo]) – repo path or object.- Return type
- Returns
Dictionary containing changes for each type of change.
New in version 0.6.1.
-
open_repo_closing(path_or_repo)[source] Returns a context manager which will return
dulwich.repo.Repoobjects unchanged, but will create a newdulwich.repo.Repowhen a filesystem path is given.New in version 0.7.0.
- Parameters
path_or_repo – Either a
dulwich.repo.Repoobject or the path of a repository.- Return type
- Overloads
open_repo_closing(path_or_repo:~_DR) ->ContextManager[~_DR]open_repo_closing(path_or_repo:Union[str,PathLike] ) ->ContextManager[Repo]