module documentation

Subversion delta operations.
Function apply_txdelta_handler Return a function that can be called repeatedly with txdelta windows.
Function apply_txdelta_handler_chunks Return a function that can be called repeatedly with txdelta windows.
Function apply_txdelta_window Apply a txdelta window to a buffer.
Function decode_length Decode a length variable.
Function encode_length Encode a length variable.
Function pack_svndiff0 Pack a SVN diff file.
Function pack_svndiff0_window Pack an individual window using svndiff0.
Function pack_svndiff_instruction Pack a SVN diff instruction
Function send_stream Send txdelta windows that create stream to handler
Function txdelta_apply_ops Apply txdelta operations to a source view.
Function unpack_svndiff0 Unpack a version 0 svndiff text.
Function unpack_svndiff_instruction Unpack a SVN diff instruction
Constant DELTA_WINDOW_SIZE Undocumented
Constant MAX_ENCODED_INT_LEN Undocumented
Constant SVNDIFF0_HEADER Undocumented
Constant TXDELTA_INVALID Undocumented
Constant TXDELTA_NEW Undocumented
Constant TXDELTA_SOURCE Undocumented
Constant TXDELTA_TARGET Undocumented
Variable __author__ Undocumented
def apply_txdelta_handler(sbuf, target_stream):
Return a function that can be called repeatedly with txdelta windows.
Parameters
sbufSource buffer
target_streamTarget stream
def apply_txdelta_handler_chunks(source_chunks, target_chunks):
Return a function that can be called repeatedly with txdelta windows.
Parameters
source_chunksUndocumented
target_chunksUndocumented
sbufSource buffer
target_streamTarget stream
def apply_txdelta_window(sbuf, window):
Apply a txdelta window to a buffer.
Parameters
sbufSource buffer (as bytestring)
window(sview_offset, sview_len, tview_len, src_ops, ops, new_data)
sview_offsetOffset of the source view
sview_lenLength of the source view
tview_lenTarget view length
src_opsOperations to apply to sview
opsOps to apply
new_dataBuffer with possible new data
Returns
Target buffer
def decode_length(text):
Decode a length variable.
Parameters
textBytestring to decode
Returns
Integer with actual length
def encode_length(len):
Encode a length variable.
Parameters
lenLength to encode
Returns
String with encoded length
def pack_svndiff0(windows):
Pack a SVN diff file.
Parameters
windowsIterator over diff windows
Returns
text
def pack_svndiff0_window(window):
Pack an individual window using svndiff0.
Parameters
windowWindow to pack
Returns
Packed diff (as bytestring)
def pack_svndiff_instruction(diff_params):
Pack a SVN diff instruction
Parameters
diff_params(action, offset, length)
actionAction
offsetOffset
lengthLength
Returns
encoded text
def send_stream(stream, handler, block_size=DELTA_WINDOW_SIZE):
Send txdelta windows that create stream to handler
Parameters
streamfile-like object to read the file from
handlertxdelta window handler function
block_sizeUndocumented
Returns
MD5 hash over the stream
def txdelta_apply_ops(src_ops, ops, new_data, sview):
Apply txdelta operations to a source view.
Parameters
src_opsSource operations, ignored.
opsList of operations (action, offset, length).
new_dataBuffer to fetch fragments with new data from
sviewSource data
Returns
Result data
def unpack_svndiff0(text):
Unpack a version 0 svndiff text.
Parameters
textText to unpack.
Returns
yields tuples with sview_offset, sview_len, tview_len, ops_len, ops, newdata
def unpack_svndiff_instruction(text):
Unpack a SVN diff instruction
Parameters
textText to parse
Returns
tuple with operation, remaining text
DELTA_WINDOW_SIZE: int =

Undocumented

Value
102400
MAX_ENCODED_INT_LEN: int =

Undocumented

Value
10
SVNDIFF0_HEADER: bytes =

Undocumented

Value
b'SVN\x00'
TXDELTA_INVALID: int =

Undocumented

Value
3
TXDELTA_NEW: int =

Undocumented

Value
2
TXDELTA_SOURCE: int =

Undocumented

Value
0
TXDELTA_TARGET: int =

Undocumented

Value
1
__author__: str =

Undocumented