class documentation
class GitClient(object):
Known subclasses: dulwich.client.AbstractHttpGitClient
, dulwich.client.LocalGitClient
, dulwich.client.TraditionalGitClient
Git smart server client.
Class Method | from |
Create an instance of this client from a urlparse.parsed object. |
Method | __init__ |
Create a new GitClient instance. |
Method | archive |
Retrieve an archive of the specified tree. |
Method | clone |
Clone a repository. |
Method | fetch |
Fetch into a target repository. |
Method | fetch |
Retrieve a pack from a git smart server. |
Method | get |
Retrieve the current refs from a git smart server. |
Method | get |
Retrieves full url to given path. |
Method | send |
Upload a pack to a remote repository. |
Static Method | _should |
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 | _report |
Undocumented |
Instance Variable | _send |
Undocumented |
overridden in
dulwich.client.AbstractHttpGitClient
, dulwich.client.LocalGitClient
, dulwich.client.SSHGitClient
, dulwich.client.SubprocessGitClient
, dulwich.client.TCPGitClient
Create an instance of this client from a urlparse.parsed object.
Parameters | |
parsedurl | Result of urlparse() |
**kwargs | Undocumented |
Returns | |
A GitClient object |
overridden in
dulwich.client.AbstractHttpGitClient
, dulwich.client.LocalGitClient
, dulwich.client.TraditionalGitClient
Create a new GitClient instance.
Parameters | |
thin | Whether or not thin packs should be retrieved |
report | Optional callback for reporting transport activity. |
quiet | Undocumented |
include | send annotated tags when sending the objects they point to |
def archive(self, path, committish, write_data, progress=None, write_error=None, format=None, subdirs=None, prefix=None):
¶
overridden in
dulwich.client.TraditionalGitClient
Retrieve an archive of the specified tree.
def clone(self, path, target_path, mkdir=True, bare=False, origin='origin', checkout=None, branch=None, progress=None, depth=None):
¶
Clone a repository.
Parameters | |
path | Undocumented |
target | Undocumented |
mkdir:bool | Undocumented |
bare | Undocumented |
origin | Undocumented |
checkout | Undocumented |
branch | Undocumented |
progress | Undocumented |
depth | Undocumented |
overridden in
dulwich.client.LocalGitClient
Fetch into a target repository.
Parameters | |
path:str | Path to fetch from (as bytestring) |
target:Repo | Target repository to fetch into |
determineOptional[ | Optional function to determine what refs to fetch. Receives dictionary of name->sha, should return list of shas to fetch. Defaults to all shas. |
progress:Optional[ | Optional progress function |
depth:Optional[ | Depth to fetch at |
Returns | |
FetchPackResult | Dictionary with all remote refs (not just those fetched) |
overridden in
dulwich.client.AbstractHttpGitClient
, dulwich.client.LocalGitClient
, dulwich.client.TraditionalGitClient
Retrieve a pack from a git smart server.
Parameters | |
path | Remote path to fetch from |
determine | Function determine what refs to fetch. Receives dictionary of name->sha, should return list of shas to fetch. |
graph | Object with next() and ack(). |
pack | Callback called for each bit of data in the pack |
progress | Callback for progress reports (strings) |
depth | Shallow fetch depth |
Returns | |
FetchPackResult object |
overridden in
dulwich.client.AbstractHttpGitClient
, dulwich.client.LocalGitClient
, dulwich.client.TraditionalGitClient
Retrieve the current refs from a git smart server.
Returns:
Parameters | |
path | Path to the repo to fetch from. (as bytestring) |
overridden in
dulwich.client.AbstractHttpGitClient
, dulwich.client.LocalGitClient
, dulwich.client.SSHGitClient
, dulwich.client.TCPGitClient
Retrieves full url to given path.
Parameters | |
path | Repository path (as string) |
Returns | |
Url to path (as string) |
overridden in
dulwich.client.AbstractHttpGitClient
, dulwich.client.LocalGitClient
, dulwich.client.TraditionalGitClient
Upload a pack to a remote repository.
Parameters | |
path | Repository path (as bytestring) |
update | 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) |
generate | Function that can return a tuple with number of objects and list of pack data to include |
progress | Optional progress function |
Returns | |
SendPackResult object | |
Raises | |
SendPackError | if server rejects the pack data |
Handle the tail of a 'git-receive-pack' request.
Parameters | |
proto:Protocol | Protocol object to read from |
capabilities:Set[ | List of negotiated capabilities |
progress:Optional[ | Optional progress reporting function |
Returns | |
dict mapping ref name to | error message if the ref failed to update None if it was updated successfully |