b._.LinesDeltaIndex(object) : class documentation

Part of bzrlib._groupcompress_py View In Hierarchy

This class indexes matches between strings.
Instance VariableslinesThe 'static' lines that will be preserved between runs.
_matching_linesA dict of {line:[matching offsets]}
line_offsetsThe byte offset for the end of each line, used to quickly map between a matching line number and the byte location
endpointThe total number of bytes in self.line_offsets
Method __init__ Undocumented
Method get_matches Return the lines which match the line in right.
Method get_matching_blocks Return the ranges in lines which match self.lines.
Method extend_lines Add more lines to the left-lines list.
Method make_delta Compute the delta for this content versus the original content.
Method _update_matching_lines Undocumented
Method _get_longest_match Look at all matches for the current line, return the longest.
Method _flush_insert Add an 'insert' request to the data stream.
Method _flush_copy Undocumented
def __init__(self, lines):
Undocumented
def _update_matching_lines(self, new_lines, index):
Undocumented
def get_matches(self, line):
Return the lines which match the line in right.
def _get_longest_match(self, lines, pos):
Look at all matches for the current line, return the longest.
ParameterslinesThe lines we are matching against
posThe current location we care about
locationsA list of lines that matched the current location. This may be None, but often we'll have already found matches for this line.
Returns(start_in_self, start_in_lines, num_lines) All values are the offset in the list (aka the line number) If start_in_self is None, then we have no matches, and this line should be inserted in the target.
def get_matching_blocks(self, lines, soft=False):
Return the ranges in lines which match self.lines.
Parameterslineslines to compress
ReturnsA list of (old_start, new_start, length) tuples which reflect a region in self.lines that is present in lines. The last element of the list is always (old_len, new_len, 0) to provide a end point for generating instructions from the matching blocks list.
def extend_lines(self, lines, index):
Add more lines to the left-lines list.
ParameterslinesA list of lines to add
indexA True/False for each node to define if it should be indexed.
def _flush_insert(self, start_linenum, end_linenum, new_lines, out_lines, index_lines):
Add an 'insert' request to the data stream.
def _flush_copy(self, old_start_linenum, num_lines, out_lines, index_lines):
Undocumented
def make_delta(self, new_lines, bytes_length=None, soft=False):
Compute the delta for this content versus the original content.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.