class documentation

Git smart server client.

Class Method from_parsedurl 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_pack Retrieve a pack from a git smart server.
Method get_refs Retrieve the current refs from a git smart server.
Method get_url Retrieves full url to given path.
Method send_pack Upload a pack to a remote repository.
Static Method _should_send_pack Undocumented
Method _handle_receive_pack_tail Handle the tail of a 'git-receive-pack' request.
Method _negotiate_receive_pack_capabilities Undocumented
Method _negotiate_upload_pack_capabilities Undocumented
Instance Variable _fetch_capabilities Undocumented
Instance Variable _report_activity Undocumented
Instance Variable _report_status_parser Undocumented
Instance Variable _send_capabilities Undocumented
@classmethod
def from_parsedurl(cls, parsedurl, **kwargs):

Create an instance of this client from a urlparse.parsed object.

Parameters
parsedurlResult of urlparse()
**kwargsUndocumented
Returns
A GitClient object
def __init__(self, thin_packs=True, report_activity=None, quiet=False, include_tags=False):

Create a new GitClient instance.

Parameters
thin_packsWhether or not thin packs should be retrieved
report_activityOptional callback for reporting transport activity.
quietUndocumented
include_tagssend 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):

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
pathUndocumented
target_pathUndocumented
mkdir:boolUndocumented
bareUndocumented
originUndocumented
checkoutUndocumented
branchUndocumented
progressUndocumented
depthUndocumented
def fetch(self, path, target, determine_wants=None, progress=None, depth=None):

Fetch into a target repository.

Parameters
path:strPath to fetch from (as bytestring)
target:RepoTarget repository to fetch into
determine_wants:Optional[Callable[[Dict[bytes, bytes], Optional[int]], List[bytes]]]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[Callable[[bytes], None]]Optional progress function
depth:Optional[int]Depth to fetch at
Returns
FetchPackResultDictionary 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.

Parameters
pathRemote 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
Returns
FetchPackResult object
def get_refs(self, path):

Retrieve the current refs from a git smart server.

Returns:

Parameters
pathPath to the repo to fetch from. (as bytestring)
def get_url(self, path):

Retrieves full url to given path.

Parameters
pathRepository path (as string)
Returns
Url to path (as string)
def send_pack(self, path, update_refs, generate_pack_data, progress=None):

Upload a pack to a remote repository.

Parameters
pathRepository 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
Returns
SendPackResult object
Raises
SendPackErrorif server rejects the pack data
@staticmethod
def _should_send_pack(new_refs):

Undocumented

def _handle_receive_pack_tail(self, proto, capabilities, progress=None):

Handle the tail of a 'git-receive-pack' request.

Parameters
proto:ProtocolProtocol object to read from
capabilities:Set[bytes]List of negotiated capabilities
progress:Optional[Callable[[bytes], None]]Optional progress reporting function
Returns
dict mapping ref name toerror message if the ref failed to update None if it was updated successfully
def _negotiate_receive_pack_capabilities(self, server_capabilities):

Undocumented

def _negotiate_upload_pack_capabilities(self, server_capabilities):

Undocumented

_fetch_capabilities =

Undocumented

_report_activity =

Undocumented

_report_status_parser =
_send_capabilities =

Undocumented