class documentation

class _ProtocolGraphWalker(object):

View In Hierarchy

A graph walker that knows the git protocol.

As a graph walker, this class implements ack(), next(), and reset(). It also contains some base methods for interacting with the wire and walking the commit tree.

The work of determining which acks to send is passed on to the implementation instance stored in _impl. The reason for this is that we do not know at object creation time what ack level the protocol requires. A call to set_ack_type() is required to set up the implementation, before any calls to next() or ack() are made.

Method __init__ Undocumented
Method ack Undocumented
Method all_wants_satisfied Check whether all the current wants are satisfied by a set of haves.
Method determine_wants Determine the wants for a set of heads.
Method handle_done Undocumented
Method next Undocumented
Method notify_done Undocumented
Method read_proto_line Read a line from the wire.
Method reset Undocumented
Method send_ack Undocumented
Method send_nak Undocumented
Method set_ack_type Undocumented
Method set_wants Undocumented
Method unread_proto_line Undocumented
Instance Variable advertise_refs Undocumented
Instance Variable client_shallow Undocumented
Instance Variable get_peeled Undocumented
Instance Variable get_symrefs Undocumented
Instance Variable handler Undocumented
Instance Variable proto Undocumented
Instance Variable shallow Undocumented
Instance Variable stateless_rpc Undocumented
Instance Variable store Undocumented
Instance Variable unshallow Undocumented
Method _handle_shallow_request Undocumented
Instance Variable _cache Undocumented
Instance Variable _cache_index Undocumented
Instance Variable _cached Undocumented
Instance Variable _impl Undocumented
Instance Variable _wants Undocumented
def __init__(self, handler, object_store, get_peeled, get_symrefs):

Undocumented

def ack(self, have_ref):

Undocumented

def all_wants_satisfied(self, haves):

Check whether all the current wants are satisfied by a set of haves.

Note: Wants are specified with set_wants rather than passed in since
in the current interface they are determined outside this class.
Parameters
havesA set of commits we know the client has.
def determine_wants(self, heads, depth=None):

Determine the wants for a set of heads.

The given heads are advertised to the client, who then specifies which refs they want using 'want' lines. This portion of the protocol is the same regardless of ack type, and in fact is used to set the ack type of the ProtocolGraphWalker.

If the client has the 'shallow' capability, this method also reads and responds to the 'shallow' and 'deepen' lines from the client. These are not part of the wants per se, but they set up necessary state for walking the graph. Additionally, later code depends on this method consuming everything up to the first 'have' line.

Returns: a list of SHA1s requested by the client

Parameters
headsa dict of refname->SHA1 to advertise
depthUndocumented
def handle_done(self, done_required, done_received):

Undocumented

def next(self):

Undocumented

def notify_done(self):

Undocumented

def read_proto_line(self, allowed):

Read a line from the wire.

Returns: A tuple of (command, value); see _split_proto_line.

Parameters
allowedAn iterable of command names that should be allowed.
Raises
UnexpectedCommandErrorIf an error occurred reading the line.
def reset(self):

Undocumented

def send_ack(self, sha, ack_type=b''):

Undocumented

def send_nak(self):

Undocumented

def set_ack_type(self, ack_type):

Undocumented

def set_wants(self, wants):

Undocumented

def unread_proto_line(self, command, value):

Undocumented

advertise_refs =

Undocumented

client_shallow: set =

Undocumented

get_peeled =

Undocumented

get_symrefs =

Undocumented

handler =

Undocumented

proto =

Undocumented

shallow: set =

Undocumented

stateless_rpc =

Undocumented

store =

Undocumented

unshallow =

Undocumented

def _handle_shallow_request(self, wants):

Undocumented

_cache: list =

Undocumented

_cache_index: int =

Undocumented

_cached: bool =

Undocumented

_impl =

Undocumented

_wants =

Undocumented