class documentation

Class for interacting with a remote git process over the wire.

Parts of the git wire protocol use 'pkt-lines' to communicate. A pkt-line consists of the length of the line as a 4-byte hex string, followed by the payload data. The length includes the 4-byte header. The special line '0000' indicates the end of a section of input and is called a 'flush-pkt'.

For details on the pkt-line format, see the cgit distribution:
Documentation/technical/protocol-common.txt
Method __enter__ Undocumented
Method __exit__ Undocumented
Method __init__ Undocumented
Method close Undocumented
Method eof Test whether the protocol stream has reached EOF.
Method read_cmd Read a command and some arguments from the git client
Method read_pkt_line Reads a pkt-line from the remote git process.
Method read_pkt_seq Read a sequence of pkt-lines from the remote git process.
Method send_cmd Send a command and some arguments to a git server.
Method unread_pkt_line Unread a single line of data into the readahead buffer.
Method write_pkt_line Sends a pkt-line to the remote git process.
Method write_sideband Write multiplexed data to the sideband.
Instance Variable read Undocumented
Instance Variable report_activity Undocumented
Instance Variable write Undocumented
Instance Variable _close Undocumented
Instance Variable _readahead Undocumented
def __enter__(self):

Undocumented

def __exit__(self, exc_type, exc_val, exc_tb):

Undocumented

def __init__(self, read, write, close=None, report_activity=None):

Undocumented

def close(self):

Undocumented

def eof(self):

Test whether the protocol stream has reached EOF.

Note that this refers to the actual stream EOF and not just a flush-pkt.

Returns: True if the stream is at EOF, False otherwise.

def read_cmd(self):

Read a command and some arguments from the git client

Only used for the TCP git protocol (git://).

Returns: A tuple of (command, [list of arguments]).

def read_pkt_line(self):

Reads a pkt-line from the remote git process.

This method may read from the readahead buffer; see unread_pkt_line.

Returns: The next string from the stream, without the length prefix, or
None for a flush-pkt ('0000').
def read_pkt_seq(self):

Read a sequence of pkt-lines from the remote git process.

Returns: Yields each line of data up to but not including the next
flush-pkt.
def send_cmd(self, cmd, *args):

Send a command and some arguments to a git server.

Only used for the TCP git protocol (git://).

Parameters
cmdThe remote service to access.
*argsList of arguments to send to remove service.
def unread_pkt_line(self, data):

Unread a single line of data into the readahead buffer.

This method can be used to unread a single pkt-line into a fixed readahead buffer.

Parameters
dataThe data to unread, without the length prefix.
Raises
ValueErrorIf more than one pkt-line is unread.
def write_pkt_line(self, line):

Sends a pkt-line to the remote git process.

Parameters
lineA string containing the data to send, without the length prefix.
def write_sideband(self, channel, blob):

Write multiplexed data to the sideband.

Parameters
channelAn int specifying the channel to write to.
blobA blob of data (as a string) to send on this channel.
read =

Undocumented

report_activity =

Undocumented

write =

Undocumented

_close =

Undocumented

_readahead =

Undocumented