Known subclasses: dulwich.client.HttpGitClient, dulwich.client.LocalGitClient, dulwich.client.TraditionalGitClient

Git smart server client.
Method __init__ Create a new GitClient instance.
Method get_url Retrieves full url to given path.
Class Method from_parsedurl Create an instance of this client from a urlparse.parsed object.
Method send_pack Upload a pack to a remote repository.
Method fetch Fetch into a target repository.
Method fetch_pack Retrieve a pack from a git smart server.
Method get_refs Retrieve the current refs from a git smart server.
Method _parse_status_report Undocumented
Method _read_side_band64k_data Read per-channel data.
Method _handle_receive_pack_head Handle the head of a 'git-receive-pack' request.
Method _negotiate_receive_pack_capabilities Undocumented
Method _handle_receive_pack_tail Handle the tail of a 'git-receive-pack' request.
Method _negotiate_upload_pack_capabilities Undocumented
Method _handle_upload_pack_head Handle the head of a 'git-upload-pack' request.
Method _handle_upload_pack_tail Handle the tail of a 'git-upload-pack' request.
def __init__(self, thin_packs=True, report_activity=None, quiet=False):
Create a new GitClient instance.
Parametersthin_packsWhether or not thin packs should be retrieved
report_activityOptional callback for reporting transport activity.
def get_url(self, path):
Retrieves full url to given path.
ParameterspathRepository path (as string)
ReturnsUrl to path (as string)
@classmethod
def from_parsedurl(cls, parsedurl, **kwargs):
Create an instance of this client from a urlparse.parsed object.
ParametersparsedurlResult of urlparse.urlparse()
ReturnsA GitClient object
def send_pack(self, path, update_refs, generate_pack_data, progress=None):
Upload a pack to a remote repository.
ParameterspathRepository path (as bytestring)
update_refsFunction 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_pack_dataFunction that can return a tuple with number of objects and list of pack data to include
progressOptional progress function
Returnsnew_refs dictionary containing the changes that were made {refname: new_ref}, including deleted refs.
RaisesSendPackErrorif server rejects the pack data
UpdateRefsErrorif the server supports report-status and rejects ref updates
def fetch(self, path, target, determine_wants=None, progress=None, depth=None):
Fetch into a target repository.
ParameterspathPath to fetch from (as bytestring)
targetTarget repository to fetch into
determine_wantsOptional function to determine what refs to fetch. Receives dictionary of name->sha, should return list of shas to fetch. Defaults to all shas.
progressOptional progress function
depthDepth to fetch at
ReturnsDictionary with all remote refs (not just those fetched)
def fetch_pack(self, path, determine_wants, graph_walker, pack_data, progress=None, depth=None):
Retrieve a pack from a git smart server.
ParameterspathRemote path to fetch from
determine_wantsFunction determine what refs to fetch. Receives dictionary of name->sha, should return list of shas to fetch.
graph_walkerObject with next() and ack().
pack_dataCallback called for each bit of data in the pack
progressCallback for progress reports (strings)
depthShallow fetch depth
ReturnsFetchPackResult object
def get_refs(self, path):
Retrieve the current refs from a git smart server.
ParameterspathPath to the repo to fetch from. (as bytestring)
def _parse_status_report(self, proto):
Undocumented
def _read_side_band64k_data(self, proto, channel_callbacks):

Read per-channel data.

This requires the side-band-64k capability.

ParametersprotoProtocol object to read from
channel_callbacksDictionary mapping channels to packet handlers to use. None for a callback discards channel data.
def _handle_receive_pack_head(self, proto, capabilities, old_refs, new_refs):
Handle the head of a 'git-receive-pack' request.
ParametersprotoProtocol object to read from
capabilitiesList of negotiated capabilities
old_refsOld refs, as received from the server
new_refsRefs to change
Returns(have, want) tuple
def _negotiate_receive_pack_capabilities(self, server_capabilities):
Undocumented
def _handle_receive_pack_tail(self, proto, capabilities, progress=None):
Handle the tail of a 'git-receive-pack' request.
ParametersprotoProtocol object to read from
capabilitiesList of negotiated capabilities
progressOptional progress reporting function
def _negotiate_upload_pack_capabilities(self, server_capabilities):
Undocumented
def _handle_upload_pack_head(self, proto, capabilities, graph_walker, wants, can_read, depth):
Handle the head of a 'git-upload-pack' request.
ParametersprotoProtocol object to read from
capabilitiesList of negotiated capabilities
graph_walkerGraphWalker instance to call .ack() on
wantsList of commits to fetch
can_readfunction that returns a boolean that indicates whether there is extra graph data to read on proto
depthDepth for request
def _handle_upload_pack_tail(self, proto, capabilities, graph_walker, pack_data, progress=None, rbufsize=_RBUFSIZE):
Handle the tail of a 'git-upload-pack' request.
ParametersprotoProtocol object to read from
capabilitiesList of negotiated capabilities
graph_walkerGraphWalker instance to call .ack() on
pack_dataFunction to call with pack data
progressOptional progress reporting function
rbufsizeRead buffer size
API Documentation for Dulwich, generated by pydoctor at 2018-11-17 19:05:54.