class documentation

class MergeDriver(Protocol):

View In Hierarchy

Protocol for merge drivers.

Method merge Perform a three-way merge.
def merge(self, ancestor: bytes, ours: bytes, theirs: bytes, path: str | None = None, marker_size: int = 7) -> tuple[bytes, bool]: ΒΆ

Perform a three-way merge.

Parameters
ancestor:bytesContent of the common ancestor version
ours:bytesContent of our version
theirs:bytesContent of their version
path:str | NoneOptional path of the file being merged
marker_size:intSize of conflict markers (default 7)
Returns
tuple[bytes, bool]Tuple of (merged content, success flag) If success is False, the content may contain conflict markers