class documentation

Abstract base class for HTTP Git Clients.

This is agonistic of the actual HTTP implementation.

Subclasses should provide an implementation of the _http_request method.

Class Method from_parsedurl Create an instance of this client from a urlparse.parsed object.
Method __init__ Create a new GitClient instance.
Method __repr__ Undocumented
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.
Instance Variable dumb Undocumented
Method _discover_references Undocumented
Method _get_url Undocumented
Method _http_request Perform HTTP request.
Method _smart_request Send a 'smart' HTTP request.
Instance Variable _base_url Undocumented
Instance Variable _report_status_parser Undocumented

Inherited from GitClient:

Method archive Retrieve an archive of the specified tree.
Method clone Clone a repository.
Method fetch Fetch into a target 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 _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, base_url, dumb=False, **kwargs):

Create a new GitClient instance.

Parameters
base_urlUndocumented
dumbUndocumented
**kwargsUndocumented
thin_packsWhether or not thin packs should be retrieved
report_activityOptional callback for reporting transport activity.
include_tagssend annotated tags when sending the objects they point to
def __repr__(self):

Undocumented

def fetch_pack(self, path, determine_wants, graph_walker, pack_data, progress=None, depth=None):

Retrieve a pack from a git smart server.

Parameters
pathPath to fetch from
determine_wantsCallback that returns list of commits to fetch
graph_walkerObject with next() and ack().
pack_dataCallback called for each bit of data in the pack
progressCallback for progress reports (strings)
depthDepth for request
Returns
FetchPackResult object
def get_refs(self, path):

Retrieve the current refs from a git smart server.

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. Receives 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 elements and pack data to upload.
progressOptional progress function
Returns
SendPackResult
Raises
SendPackErrorif server rejects the pack data
dumb =

Undocumented

def _discover_references(self, service, base_url):

Undocumented

def _get_url(self, path):

Undocumented

def _http_request(self, url, headers=None, data=None):

Perform HTTP request.

Parameters
urlRequest URL.
headersOptional custom headers to override defaults.
dataRequest data.
Returns
Tuple (response, read), where response is an urllib3 response object with additional content_type and redirect_location properties, and read is a consumable read method for the response data.
def _smart_request(self, service, url, data):

Send a 'smart' HTTP request.

This is a simple wrapper around _http_request that sets a couple of extra headers.

_base_url =

Undocumented

_report_status_parser =