class TraditionalGitClient(GitClient):
Known subclasses: dulwich.client.SSHGitClient, dulwich.client.SubprocessGitClient, dulwich.client.TCPGitClient
Constructor: TraditionalGitClient(path_encoding, thin_packs, report_activity, quiet, ...)
Traditional Git client.
| Method | __init__ |
Initialize a TraditionalGitClient. |
| Method | archive |
Request an archive of a specific commit. |
| Method | fetch |
Retrieve a pack from a git smart server. |
| Method | get |
Retrieve the current refs from a git smart server. |
| Method | send |
Upload a pack to a remote repository. |
| Constant | DEFAULT |
Undocumented |
| Instance Variable | protocol |
Undocumented |
| Method | _connect |
Create a connection to the server. |
| Instance Variable | _remote |
Undocumented |
| Instance Variable | _report |
Undocumented |
Inherited from GitClient:
| Class Method | from |
Create an instance of this client from a urlparse.parsed object. |
| Method | clone |
Clone a repository. |
| Method | close |
Close the client and release any resources. |
| Method | fetch |
Fetch into a target repository. |
| Method | fetch |
Fetch into a target repository, using bundle URIs for bootstrap. |
| Method | get |
Retrieves full url to given path. |
| 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 |
str = DEFAULT_ENCODING, thin_packs: bool = True, report_activity: Callable[ [ int, str], None] | None = None, quiet: bool = False, include_tags: bool = False):
¶
dulwich.client.GitClient.__init__dulwich.client.SSHGitClient, dulwich.client.TCPGitClientInitialize a TraditionalGitClient.
| Parameters | |
pathstr | Encoding for paths (default: utf-8) |
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 |
bytes, committish: bytes, write_data: Callable[ [ bytes], None], progress: Callable[ [ bytes], None] | None = None, write_error: Callable[ [ bytes], None] | None = None, format: bytes | None = None, subdirs: Sequence[ bytes] | None = None, prefix: bytes | None = None):
¶
dulwich.client.GitClient.archiveRequest an archive of a specific commit.
| Parameters | |
path:bytes | Repository path |
committish:bytes | Commit ID or ref to archive |
writeCallable[ | Function to write archive data |
progress:Callable[ | Optional progress callback |
writeCallable[ | Optional error callback |
format:bytes | None | Optional archive format |
subdirs:Sequence[ | Optional subdirectories to include |
prefix:bytes | None | Optional prefix for archived files |
bytes | str, 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 git smart server.
| Parameters | |
path:bytes | str | 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 | Desired Git protocol version. By default the highest mutually supported protocol version will be used. |
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 |
bytes, protocol_version: int | None = None, ref_prefix: Sequence[ bytes] | None = None) -> LsRemoteResult:
¶
dulwich.client.GitClient.get_refsRetrieve the current refs from a git smart server.
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 remote repository.
| Parameters | |
path: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) |
generateGeneratePackDataFunc | Function that can return a tuple with number of objects and pack data to upload. |
progress:Callable[ | Optional callback called with progress updates |
pushSequence[ | Optional list of push options to send to the server |
atomic:bool | If True, request atomic push (all refs update or none do) |
| Returns | |
SendPackResult | SendPackResult |
| Raises | |
SendPackError | if server rejects the pack data |
GitProtocolError | if atomic push is requested but server doesn't support it |
bytes, path: str | bytes, protocol_version: int | None = None) -> tuple[ Protocol, Callable[ [], bool], IO[ bytes] | None]:
¶
dulwich.client.SSHGitClient, dulwich.client.SubprocessGitClient, dulwich.client.TCPGitClientCreate a connection to the server.
This method is abstract - concrete implementations should implement their own variant which connects to the server and returns an initialized Protocol object with the service ready for use and a can_read function which may be used to see if reads would block.
| Parameters | |
cmd:bytes | The git service name to which we should connect. |
path:str | bytes | The path we should pass to the service. (as bytestirng) |
protocolint | None | Desired Git protocol version. By default the highest mutually supported protocol version will be used. |
| Returns | |
tuple[ | Undocumented |