Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
FilePersistence::DiscardConflictingDeletesComponent Class Reference

The DiscardConflictingDeletesComponent detects subtrees which one branch removes entirely and another alters. More...

Inheritance diagram for FilePersistence::DiscardConflictingDeletesComponent:
FilePersistence::MergePipelineComponent

Public Member Functions

virtual void run (MergeData &mergeData) override
 
- Public Member Functions inherited from FilePersistence::MergePipelineComponent
virtual ~MergePipelineComponent ()
 

Private Member Functions

void computeDeletedSubtrees (ChangeGraph &cg, QList< MergeChange * > deletesToLookAt)
 
QList< MergeChange * > deletesConflictingWithMoveOrRelabel (ChangeGraph &cg)
 
bool isAncestorDeleteInList (MergeChange *change, QList< MergeChange * > deletesToLookAt)
 
bool isSubtreeCompletelyDeleted (MergeChange *deleteChange, MergeChange::Branch deletingBranch, ChangeGraph &cg)
 
void removeSuitableDeletes (ChangeGraph &cg, QList< MergeChange * > deletesToLookAt)
 

Private Attributes

QHash< MergeChange *, MergeChange * > parentDelete
 
QMultiHash< MergeChange *, MergeChange::BranchsubtreeIsDeleted
 
QMultiHash< MergeChange *, MergeChange::BranchsubtreeIsNotDeleted
 

Detailed Description

The DiscardConflictingDeletesComponent detects subtrees which one branch removes entirely and another alters.

There are two allowed cases:

In all such cases, the delete operations are discarded and only the others are left. It's important to run this component before any changes have been removed. Otherwise it could happen that some nodes are deleted, and then the parent nodes are moved by the other branch which is unaware of the deletions and results in a tree with holes.

Member Function Documentation

◆ computeDeletedSubtrees()

void FilePersistence::DiscardConflictingDeletesComponent::computeDeletedSubtrees ( ChangeGraph cg,
QList< MergeChange * >  deletesToLookAt 
)
private

◆ deletesConflictingWithMoveOrRelabel()

QList< MergeChange * > FilePersistence::DiscardConflictingDeletesComponent::deletesConflictingWithMoveOrRelabel ( ChangeGraph cg)
private

◆ isAncestorDeleteInList()

bool FilePersistence::DiscardConflictingDeletesComponent::isAncestorDeleteInList ( MergeChange change,
QList< MergeChange * >  deletesToLookAt 
)
private

◆ isSubtreeCompletelyDeleted()

bool FilePersistence::DiscardConflictingDeletesComponent::isSubtreeCompletelyDeleted ( MergeChange deleteChange,
MergeChange::Branch  deletingBranch,
ChangeGraph cg 
)
private

◆ removeSuitableDeletes()

void FilePersistence::DiscardConflictingDeletesComponent::removeSuitableDeletes ( ChangeGraph cg,
QList< MergeChange * >  deletesToLookAt 
)
private

◆ run()

void FilePersistence::DiscardConflictingDeletesComponent::run ( MergeData mergeData)
overridevirtual

Member Data Documentation

◆ parentDelete

QHash<MergeChange*, MergeChange*> FilePersistence::DiscardConflictingDeletesComponent::parentDelete
private

◆ subtreeIsDeleted

QMultiHash<MergeChange*, MergeChange::Branch> FilePersistence::DiscardConflictingDeletesComponent::subtreeIsDeleted
private

◆ subtreeIsNotDeleted

QMultiHash<MergeChange*, MergeChange::Branch> FilePersistence::DiscardConflictingDeletesComponent::subtreeIsNotDeleted
private