collaboration.merge module¶
Helper class that resolves conflicts |
|
Structure representing an individual merge conflict |
- class ConflictHandler[source]¶
Bases:
object
Helper class that resolves conflicts
- abstract handle(conflicts: Dict[str, MergeConflict]) bool [source]¶
Handle any merge conflicts by calling their success() function with a merged value
- Parameters:
conflicts (Dict[str, MergeConflict]) – Map of conflict id to conflict structure
- Returns:
True if all conflicts were successfully merged
- Return type:
- class MergeConflict(handle: LP_BNAnalysisMergeConflict)[source]¶
Bases:
object
Structure representing an individual merge conflict
- Parameters:
handle (LP_BNAnalysisMergeConflict) –
- get_path_item(path_key: str) object | None [source]¶
Get item in the merge conflict’s path for a given key.
- success(value: Dict[str, object] | None) bool [source]¶
Call this when you’ve resolved the conflict to save the result
- property base: Dict[str, object] | None¶
Json object for conflicting data in the base snapshot
- Returns:
Python dictionary from parsed json
- property base_file: FileMetadata | None¶
FileMetadata with contents of file for base snapshot This function is slow! Only use it if you really need it.
- Returns:
FileMetadata object
- property base_snapshot: Snapshot | None¶
Snapshot which is the parent of the two being merged
- Returns:
Snapshot object
- property data_type: MergeConflictDataType¶
Type of data in the conflict, Text/Json/Binary
- Returns:
Conflict data type
- property database: Database¶
Database backing all snapshots in the merge conflict
- Returns:
Database object
- property first: Dict[str, object] | None¶
Json object for conflicting data in the first snapshot
- Returns:
Python dictionary from parsed json
- property first_file: FileMetadata | None¶
FileMetadata with contents of file for first snapshot This function is slow! Only use it if you really need it.
- Returns:
FileMetadata object
- property key: str¶
Lookup key for the merge conflict, ideally a tree path that contains the name of the conflict and all the recursive children leading up to this conflict.
- Returns:
Key name
- property second: Dict[str, object] | None¶
Json object for conflicting data in the second snapshot
- Returns:
Python dictionary from parsed json
- property second_file: FileMetadata | None¶
FileMetadata with contents of file for second snapshot This function is slow! Only use it if you really need it.
- Returns:
FileMetadata object