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.
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.
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.
resolved_body
instance-attribute
¶
resolved_body
The resolution may be a deleted file, in which case it will be the special DELETE_TOKEN.
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.
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.
resolved_body
instance-attribute
¶
resolved_body
The resolution may be a deleted file, in which case it will be the special DELETE_TOKEN.
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.
resolved_body
instance-attribute
¶
resolved_body
The resolution may be a deleted file, in which case it will be the special DELETE_TOKEN.
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.
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.
conflict_path
instance-attribute
¶
conflict_path
As their content is deleted, this is just 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.
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.
resolved_body
instance-attribute
¶
resolved_body
The resolution may be a deleted file, in which case it will be the special DELETE_TOKEN.