class LocalGitClient(GitClient):
Constructors: LocalGitClient.from_parsedurl(parsedurl, thin_packs, report_activity, quiet, ...), LocalGitClient(thin_packs, report_activity, config, quiet, ...)
Git Client that just uses a local on-disk repository.
| Class Method | from |
Create an instance of LocalGitClient from a parsed URL. |
| Method | __init__ |
Create a new LocalGitClient instance. |
| Method | clone |
Clone a local repository. |
| Method | fetch |
Fetch into a target repository. |
| Method | fetch |
Retrieve a pack from a local on-disk repository. |
| Method | get |
Retrieve the current refs from a local on-disk repository. |
| Method | get |
Get the URL for a local file path. |
| Method | send |
Upload a pack to a local on-disk repository. |
| Class Method | _open |
Open a local repository. |
| Instance Variable | _include |
Undocumented |
| Instance Variable | _quiet |
Undocumented |
| Instance Variable | _report |
Undocumented |
Inherited from GitClient:
| Method | archive |
Retrieve an archive of the specified tree. |
| Method | close |
Close the client and release any resources. |
| Method | fetch |
Fetch into a target repository, using bundle URIs for bootstrap. |
| Instance Variable | protocol |
Undocumented |
| Static Method | _should |
Undocumented |
| Static Method | _warn |
Undocumented |
| Method | _handle |
Handle the tail of a 'git-receive-pack' request. |
| Method | _negotiate |
Undocumented |
| Method | _negotiate |
Undocumented |
| Instance Variable | _fetch |
Undocumented |
| Instance Variable | _report |
Undocumented |
| Instance Variable | _send |
Undocumented |
ParseResult, thin_packs: bool = True, report_activity: Callable[ [ int, str], None] | None = None, quiet: bool = False, include_tags: bool = False, dumb: bool = False, username: str | None = None, password: str | None = None, config: Config | None = None) -> LocalGitClient:
¶
dulwich.client.GitClient.from_parsedurlCreate an instance of LocalGitClient from a parsed URL.
| Parameters | |
parsedurl:ParseResult | Result of urlparse() |
thinbool | Whether or not thin packs should be retrieved |
reportCallable[ | Optional callback for reporting transport activity |
quiet:bool | Whether to suppress progress output |
includebool | Whether to include tags |
dumb:bool | Whether to use dumb protocol (not used for LocalGitClient) |
username:str | None | Username for authentication (not used for LocalGitClient) |
password:str | None | Password for authentication (not used for LocalGitClient) |
config:Config | None | Optional configuration object |
| Returns | |
LocalGitClient | A LocalGitClient instance |
bool = True, report_activity: Callable[ [ int, str], None] | None = None, config: Config | None = None, quiet: bool = False, include_tags: bool = False):
¶
dulwich.client.GitClient.__init__Create a new LocalGitClient instance.
| Parameters | |
thinbool | Whether or not thin packs should be retrieved |
reportCallable[ | Optional callback for reporting transport activity. |
config:Config | None | Optional configuration object |
quiet:bool | Whether to suppress progress output |
includebool | Whether to include tags |
str, target_path: str, mkdir: bool = True, bare: bool = False, origin: str | None = 'origin', checkout: bool | None = None, branch: str | None = None, progress: Callable[ [ bytes], None] | None = None, depth: int | None = None, ref_prefix: Sequence[ bytes] | None = None, filter_spec: bytes | None = None, protocol_version: int | None = None, bundle_uri: str | None = None) -> Repo:
¶
dulwich.client.GitClient.cloneClone a local repository.
For local clones, we can detect the object format before creating the target repository.
Note: bundle_uri is accepted for API compatibility but ignored for local clones since there's no benefit to using bundles for local operations.
bytes | str, target: BaseRepo, determine_wants: DetermineWantsFunc | None = None, progress: Callable[ [ bytes], None] | None = None, depth: int | None = None, ref_prefix: Sequence[ bytes] | None = None, filter_spec: bytes | None = None, protocol_version: int | None = None, shallow_since: str | None = None, shallow_exclude: list[ str] | None = None) -> FetchPackResult:
¶
dulwich.client.GitClient.fetchFetch into a target repository.
| Parameters | |
path:bytes | str | Path to fetch from (as bytestring) |
target:BaseRepo | Target repository to fetch into |
determineDetermineWantsFunc | None | Optional function determine what refs to fetch. Receives dictionary of name->sha, should return list of shas to fetch. Defaults to all shas. |
progress:Callable[ | Optional progress function |
depth:int | None | Shallow fetch depth |
refSequence[ | List of prefixes of desired references, as a list of bytestrings. Filtering is done by the server if supported, and client side otherwise. |
filterbytes | None | A git-rev-list-style object filter spec, as bytestring. Only used if the server supports the Git protocol-v2 'filter' feature, and ignored otherwise. |
protocolint | None | Optional Git protocol version |
shallowstr | None | Deepen the history to include commits after this date |
shallowlist[ | Deepen the history to exclude commits reachable from these refs |
| Returns | |
FetchPackResult | FetchPackResult object |
str | bytes, determine_wants: DetermineWantsFunc, graph_walker: GraphWalker, pack_data: Callable[ [ bytes], int], progress: Callable[ [ bytes], None] | None = None, depth: int | None = None, ref_prefix: Sequence[ bytes] | None = None, filter_spec: bytes | None = None, protocol_version: int | None = None, shallow_since: str | None = None, shallow_exclude: list[ str] | None = None) -> FetchPackResult:
¶
dulwich.client.GitClient.fetch_packRetrieve a pack from a local on-disk repository.
| Parameters | |
path:str | bytes | Remote path to fetch from |
determineDetermineWantsFunc | Function determine what refs to fetch. Receives dictionary of name->sha, should return list of shas to fetch. |
graphGraphWalker | Object with next() and ack(). |
packCallable[ | Callback called for each bit of data in the pack |
progress:Callable[ | Callback for progress reports (strings) |
depth:int | None | Shallow fetch depth |
refSequence[ | List of prefixes of desired references, as a list of bytestrings. Filtering is done by the server if supported, and client side otherwise. |
filterbytes | None | A git-rev-list-style object filter spec, as bytestring. Only used if the server supports the Git protocol-v2 'filter' feature, and ignored otherwise. |
protocolint | None | Optional Git protocol version |
shallowstr | None | Deepen the history to include commits after this date |
shallowlist[ | Deepen the history to exclude commits reachable from these refs |
| Returns | |
FetchPackResult | FetchPackResult object |
str | bytes, protocol_version: int | None = None, ref_prefix: Sequence[ bytes] | None = None) -> LsRemoteResult:
¶
dulwich.client.GitClient.get_refsRetrieve the current refs from a local on-disk repository.
str | bytes, update_refs: Callable[ [ dict[ Ref, ObjectID]], dict[ Ref, ObjectID]], generate_pack_data: GeneratePackDataFunc, progress: Callable[ [ bytes], None] | None = None, push_options: Sequence[ bytes] | None = None, atomic: bool = False) -> SendPackResult:
¶
dulwich.client.GitClient.send_packUpload a pack to a local on-disk repository.
| Parameters | |
path:str | bytes | Repository path (as bytestring) |
updateCallable[ | Function to determine changes to remote refs. Receive dict with existing remote refs, returns dict with changed refs (name -> sha, where sha=ZERO_SHA for deletions) with number of items and pack data to upload. |
generateGeneratePackDataFunc | Function that generates pack data given have and want object sets |
progress:Callable[ | Optional progress function |
pushSequence[ | Optional list of push options (not used for local repos) |
atomic:bool | If True, use atomic ref updates (all succeed or all fail) |
| Returns | |
SendPackResult | SendPackResult |
| Raises | |
SendPackError | if server rejects the pack data |