b.t.TextMerge(object) : class documentation

Part of bzrlib.textmerge View In Hierarchy

Known subclasses: bzrlib.textmerge.Merge2, bzrlib.versionedfile.PlanWeaveMerge

Base class for text-mergers Subclasses must implement _merge_struct.

Many methods produce or consume structured merge information. This is an iterable of tuples of lists of lines. Each tuple may have a length of 1 - 3, depending on whether the region it represents is conflicted.

Unconflicted region tuples have length 1. Conflicted region tuples have length 2 or 3. Index 1 is text_a, e.g. THIS. Index 1 is text_b, e.g. OTHER. Index 2 is optional. If present, it represents BASE.

Method __init__ Undocumented
Method struct_to_lines Convert merge result tuples to lines
Method iter_useful Iterate through input tuples, skipping empty ones.
Method merge_lines Produce an iterable of lines, suitable for writing to a file
Method merge_struct Produce structured merge info
Static Method reprocess_struct Perform a two-way merge on structural merge info.
Method _merge_struct Return structured merge info. Must be implemented by subclasses.
def __init__(self, a_marker=A_MARKER, b_marker=B_MARKER, split_marker=SPLIT_MARKER):
Undocumented
def _merge_struct(self):
Return structured merge info. Must be implemented by subclasses. See TextMerge docstring for details on the format.
def struct_to_lines(self, struct_iter):
Convert merge result tuples to lines
def iter_useful(self, struct_iter):
Iterate through input tuples, skipping empty ones.
def merge_lines(self, reprocess=False):
Produce an iterable of lines, suitable for writing to a file Returns a tuple of (line iterable, conflict indicator) If reprocess is True, a two-way merge will be performed on the intermediate structure, to reduce conflict regions.
def merge_struct(self, reprocess=False):
Produce structured merge info
@staticmethod
def reprocess_struct(struct_iter):
Perform a two-way merge on structural merge info. This reduces the size of conflict regions, but breaks the connection between the BASE text and the conflict region.

This process may split a single conflict region into several smaller ones, but will not introduce new conflicts.

API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.