Skip to content

API: typed_five_tuple

ALL_CONFLICT_TYPES module-attribute

ALL_CONFLICT_TYPES = ['modify_modify', 'added_by_us', 'added_by_them', 'delete_modify', 'modify_delete', 'delete_delete', 'add_add']

ConflictCase module-attribute

ConflictCase = Union[DeleteDeleteConflictCase, AddedByUsConflictCase, AddedByThemConflictCase, ModifyDeleteConflictCase, DeleteModifyConflictCase, ModifyModifyConflictCase, AddAddConflictCase]

DELETE_TOKEN module-attribute

DELETE_TOKEN = '‽DELETED‽'

Indicate that a file was deleted in a commit. Interrobang punctuation is used to avoid confusion with real file contents.

T_ALL_CONFLICT_TYPES module-attribute

T_ALL_CONFLICT_TYPES = Literal['modify_modify', 'added_by_us', 'added_by_them', 'delete_modify', 'modify_delete', 'delete_delete', 'add_add']

__all__ module-attribute

__all__ = ['ModifyModifyConflictCase', 'AddedByUsConflictCase', 'AddedByThemConflictCase', 'DeleteModifyConflictCase', 'ModifyDeleteConflictCase', 'DeleteDeleteConflictCase', 'AddAddConflictCase', 'ConflictCase', 'ALL_CONFLICT_TYPES', 'T_ALL_CONFLICT_TYPES', 'DELETE_TOKEN']

AddAddConflictCase dataclass

AddAddConflictCase(base_path, ours_path, theirs_path, base_content, ours_content, theirs_content, conflict_path, conflict_body, resolved_path, resolved_body, conflict_type='add_add')

Represents a merge conflict where a file has been added in both branches. From the human perspective, this happens when there's a rename-rename. Git will show this as a delete-delete conflict, followed by an add by us and an add by them.

NOTE: This conflict can generate two conflicting files with the same content in two different paths.

base_content instance-attribute

base_content

base_path instance-attribute

base_path

conflict_body instance-attribute

conflict_body

The content of the file as it exists in the working tree, with conflict markers.

conflict_path instance-attribute

conflict_path

In the add-add case, this is our path.

conflict_type class-attribute instance-attribute

conflict_type = 'add_add'

ours_content instance-attribute

ours_content

ours_path instance-attribute

ours_path

resolved_body instance-attribute

resolved_body

The resolution may be a deleted file, in which case it will be the special DELETE_TOKEN.

resolved_path instance-attribute

resolved_path

theirs_content instance-attribute

theirs_content

theirs_path instance-attribute

theirs_path

AddedByThemConflictCase dataclass

AddedByThemConflictCase(base_path, ours_path, theirs_path, base_content, ours_content, theirs_content, conflict_path, conflict_body, resolved_path, resolved_body, conflict_type='added_by_them')

Represents a merge conflict where the base file has been added on their side but conflicts.

Potentially one of the rarest forms of merge conflicts. From the human perspective it happens when one side adds a new file, but the other side moved the directory the file was added to, and then something goes wrong with the merge.

Git will show this as an "added by them" conflict.

base_content instance-attribute

base_content

base_path instance-attribute

base_path

conflict_body instance-attribute

conflict_body

The contents of this file will NOT contain conflict markers, because it is a new file that was added in one side.

conflict_path instance-attribute

conflict_path

conflict_type class-attribute instance-attribute

conflict_type = 'added_by_them'

ours_content instance-attribute

ours_content

ours_path instance-attribute

ours_path

resolved_body instance-attribute

resolved_body

The resolution may be a deleted file, in which case it will be the special DELETE_TOKEN.

resolved_path instance-attribute

resolved_path

theirs_content instance-attribute

theirs_content

theirs_path instance-attribute

theirs_path

AddedByUsConflictCase dataclass

AddedByUsConflictCase(base_path, ours_path, theirs_path, base_content, ours_content, theirs_content, conflict_path, conflict_body, resolved_path, resolved_body, conflict_type='added_by_us')

Represents a merge conflict where the base file has been added on our side but conflicts.

Potentially one of the rarest forms of merge conflicts. From the human perspective it happens when one side adds a new file, but the other side moved the directory the file was added to, and then something goes wrong with the merge.

Git will show this as an "added by us" conflict.

base_content instance-attribute

base_content

base_path instance-attribute

base_path

conflict_body instance-attribute

conflict_body

The contents of this file will NOT contain conflict markers, because it is a new file that was added in one side.

conflict_path instance-attribute

conflict_path

conflict_type class-attribute instance-attribute

conflict_type = 'added_by_us'

ours_content instance-attribute

ours_content

ours_path instance-attribute

ours_path

resolved_body instance-attribute

resolved_body

The resolution may be a deleted file, in which case it will be the special DELETE_TOKEN.

resolved_path instance-attribute

resolved_path

theirs_content instance-attribute

theirs_content

theirs_path instance-attribute

theirs_path

DeleteDeleteConflictCase dataclass

DeleteDeleteConflictCase(base_path, ours_path, theirs_path, base_content, ours_content, theirs_content, conflict_path, conflict_body, resolved_path, resolved_body, conflict_type='delete_delete')

Represents a merge conflict where the base file has been deleted from both sides. From the human perspective, this happens when there's a rename-rename. Git will show this as a delete-delete conflict, followed by an add by us and an add by them.

base_content instance-attribute

base_content

base_path instance-attribute

base_path

conflict_body instance-attribute

conflict_body

conflict_path instance-attribute

conflict_path

In the delete-delete case, this is just base_path.

conflict_type class-attribute instance-attribute

conflict_type = 'delete_delete'

ours_content instance-attribute

ours_content

ours_path instance-attribute

ours_path

resolved_body instance-attribute

resolved_body

The resolution may be a deleted file, in which case it will be the special DELETE_TOKEN.

resolved_path instance-attribute

resolved_path

theirs_content instance-attribute

theirs_content

theirs_path instance-attribute

theirs_path

DeleteModifyConflictCase dataclass

DeleteModifyConflictCase(base_path, ours_path, theirs_path, base_content, ours_content, theirs_content, conflict_path, conflict_body, resolved_path, resolved_body, conflict_type='delete_modify')

Represents a merge conflict where the base file has been deleted from our side, and modified on their branch.

base_content instance-attribute

base_content

base_path instance-attribute

base_path

conflict_body instance-attribute

conflict_body

conflict_path instance-attribute

conflict_path

As our content is deleted, this is just base_path.

conflict_type class-attribute instance-attribute

conflict_type = 'delete_modify'

ours_content instance-attribute

ours_content

ours_path instance-attribute

ours_path

resolved_body instance-attribute

resolved_body

The resolution may be a deleted file, in which case it will be the special DELETE_TOKEN.

resolved_path instance-attribute

resolved_path

The resolution may be a deleted file, in which case this is None.

theirs_content instance-attribute

theirs_content

theirs_path instance-attribute

theirs_path

ModifyDeleteConflictCase dataclass

ModifyDeleteConflictCase(base_path, ours_path, theirs_path, base_content, ours_content, theirs_content, conflict_path, conflict_body, resolved_path, resolved_body, conflict_type='modify_delete')

Represents a merge conflict where the base file has been deleted from their side, and modified on our branch.

base_content instance-attribute

base_content

base_path instance-attribute

base_path

conflict_body instance-attribute

conflict_body

conflict_path instance-attribute

conflict_path

As their content is deleted, this is just ours_path.

conflict_type class-attribute instance-attribute

conflict_type = 'modify_delete'

ours_content instance-attribute

ours_content

ours_path instance-attribute

ours_path

resolved_body instance-attribute

resolved_body

The resolution may be a deleted file, in which case it will be the special DELETE_TOKEN.

resolved_path instance-attribute

resolved_path

The resolution may be a deleted file, in which case this is None.

theirs_content instance-attribute

theirs_content

theirs_path instance-attribute

theirs_path

ModifyModifyConflictCase dataclass

ModifyModifyConflictCase(base_path, ours_path, theirs_path, base_content, ours_content, theirs_content, conflict_path, conflict_body, resolved_path, resolved_body, conflict_type='modify_modify')

Represents a single merge conflict case with all relevant file contents.

base_content instance-attribute

base_content

base_path instance-attribute

base_path

conflict_body instance-attribute

conflict_body

conflict_path instance-attribute

conflict_path

conflict_type class-attribute instance-attribute

conflict_type = 'modify_modify'

ours_content instance-attribute

ours_content

ours_path instance-attribute

ours_path

resolved_body instance-attribute

resolved_body

The resolution may be a deleted file, in which case it will be the special DELETE_TOKEN.

resolved_path instance-attribute

resolved_path

theirs_content instance-attribute

theirs_content

theirs_path instance-attribute

theirs_path