66 SCH_DIFFER ourDiffer( m_ancestor.get(), m_ours.get() );
67 SCH_DIFFER theirDiffer( m_ancestor.get(), m_theirs.get() );
71 BOOST_CHECK( plan.
actions.empty() );
73 SCH_MERGE_APPLIER applier( m_ancestor.get(), m_ours.get(), m_theirs.get(), plan );
74 BOOST_CHECK( applier.
Apply() );
77 SCH_DIFFER sanity( m_ancestor.get(), m_ours.get() );
79 BOOST_CHECK( sanityResult.
Empty() );
89 m_ancestor->Settings().m_SchDrawingSheetFileName = wxS(
"ancestor.kicad_wks" );
90 m_ours->Settings().m_SchDrawingSheetFileName = wxS(
"ours.kicad_wks" );
91 m_theirs->Settings().m_SchDrawingSheetFileName = wxS(
"ancestor.kicad_wks" );
96 SCH_MERGE_APPLIER applier( m_ancestor.get(), m_ours.get(), m_theirs.get(), plan );
97 BOOST_CHECK( applier.
Apply() );
99 BOOST_CHECK_EQUAL( m_ancestor->Settings().m_SchDrawingSheetFileName,
"ours.kicad_wks" );
109 SCH_SHEET_LIST sheets = m_ours->BuildSheetListSortedByPageNumbers();
118 subjectUuid = subject->
m_Uuid;
130 SCH_DIFFER ourDiffer( m_ancestor.get(), m_ours.get() );
131 SCH_DIFFER theirDiffer( m_ancestor.get(), m_theirs.get() );
137 SCH_MERGE_APPLIER applier( m_ancestor.get(), m_ours.get(), m_theirs.get(), plan );
138 BOOST_CHECK( applier.
Apply() );
148 if( item->m_Uuid == subjectUuid )
175 SCH_SYMBOL* victimOurs = findFirstSymbol( m_ours.get() );
177 victimUuid = victimOurs->
m_Uuid;
185 if( item->m_Uuid == aUuid )
187 path.LastScreen()->DeleteItem( item );
194 removeByUuid( m_ours.get(), victimUuid );
195 removeByUuid( m_theirs.get(), victimUuid );
197 SCH_DIFFER ourDiffer( m_ancestor.get(), m_ours.get() );
198 SCH_DIFFER theirDiffer( m_ancestor.get(), m_theirs.get() );
203 SCH_MERGE_APPLIER applier( m_ancestor.get(), m_ours.get(), m_theirs.get(), plan );
204 BOOST_CHECK( applier.
Apply() );
211 BOOST_CHECK( item->m_Uuid != victimUuid );
226 SCH_SHEET_LIST sheets = m_ours->BuildSheetListSortedByPageNumbers();
234 oursSubject =
static_cast<SCH_SYMBOL*
>( item );
235 subjectUuid = oursSubject->
m_Uuid;
253 if( item->m_Uuid == subjectUuid )
261 SCH_DIFFER ourDiffer( m_ancestor.get(), m_ours.get() );
262 SCH_DIFFER theirDiffer( m_ancestor.get(), m_theirs.get() );
266 SCH_MERGE_APPLIER applier( m_ancestor.get(), m_ours.get(), m_theirs.get(), plan );
267 BOOST_CHECK( applier.
Apply() );
277 if( item->m_Uuid == subjectUuid )
Three-way merge plan generator.
MERGE_PLAN Plan(const DOCUMENT_DIFF &aAncestorOurs, const DOCUMENT_DIFF &aAncestorTheirs) const
Plan the merge given the canonical pair of diffs.
Diff two already-parsed SCHEMATICs and produce a DOCUMENT_DIFF.
DOCUMENT_DIFF Diff() override
Produce a DOCUMENT_DIFF of the inputs the concrete differ was constructed with.
Materialize a MERGE_PLAN into a merged SCHEMATIC by mutating the ancestor in place.
bool Apply()
Apply the plan to the ancestor.
const REPORT & GetReport() const
Holds all the data relating to one schematic.
SCH_SHEET_LIST BuildSheetListSortedByPageNumbers() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void SetPosition(const VECTOR2I &aPosition) override
VECTOR2I GetPosition() const override
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
The full set of changes between two parsed documents of one type.
Result of planning a 3-way merge.
std::vector< ITEM_RESOLUTION > actions
bool drawingSheetFileTouched
bool projectFileTouched
True iff the applier resolved state that lives in the .kicad_pro.
bool ercSeveritiesTouched
std::unique_ptr< SCHEMATIC > m_ancestor
std::unique_ptr< SCHEMATIC > m_ours
std::unique_ptr< SCHEMATIC > m_theirs
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(EmptyPlanIsNoOp)
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I