35 std::vector<BOARD_ITEM*>& aAdded, std::vector<BOARD_ITEM*>& aRemoved,
36 std::vector<BOARD_ITEM*>& aChanged )
38 auto it1 = aAncestorSet.begin();
39 auto it2 = aOtherSet.begin();
41 while( it1 != aAncestorSet.end() && it2 != aOtherSet.end() )
48 aRemoved.push_back( item1 );
53 aAdded.push_back( item2 );
58 if( !( *item1 == *item2 ) )
59 aChanged.push_back( item1 );
72 const auto ancestor_set = aAncestor->
GetItemSet();
83 auto repo =
const_cast<git_repository*
>( git_merge_driver_source_repo(
m_mergeDriver ) );
84 const git_index_entry* ancestor = git_merge_driver_source_ancestor(
m_mergeDriver );
85 const git_index_entry* ours = git_merge_driver_source_ours(
m_mergeDriver );
86 const git_index_entry* theirs = git_merge_driver_source_theirs(
m_mergeDriver );
90 git_blob* ancestor_blob;
92 git_blob* theirs_blob;
94 if( git_blob_lookup( &ancestor_blob, repo, &ancestor->id ) != 0 )
99 if( git_blob_lookup( &ours_blob, repo, &ours->id ) != 0 )
101 git_blob_free( ancestor_blob );
102 return GIT_ENOTFOUND;
105 if( git_blob_lookup( &theirs_blob, repo, &theirs->id ) != 0 )
107 git_blob_free( ancestor_blob );
108 git_blob_free( ours_blob );
109 return GIT_ENOTFOUND;
120 std::unique_ptr<BOARD> ancestor_board;
121 std::unique_ptr<BOARD> ours_board;
122 std::unique_ptr<BOARD> theirs_board;
126 ancestor_board.reset(
static_cast<BOARD*
>( ancestor_parser.
Parse() ) );
127 ours_board.reset(
static_cast<BOARD*
>( ours_parser.
Parse() ) );
128 theirs_board.reset(
static_cast<BOARD*
>( theirs_parser.
Parse() ) );
132 git_blob_free( ancestor_blob );
133 git_blob_free( ours_blob );
134 git_blob_free( theirs_blob );
138 git_blob_free( ancestor_blob );
139 git_blob_free( ours_blob );
140 git_blob_free( theirs_blob );
147 std::set_intersection( ancestor_ours_differences.
m_changed.begin(), ancestor_ours_differences.
m_changed.end(),
148 ancestor_theirs_differences.
m_removed.begin(), ancestor_theirs_differences.
m_removed.end(),
152 std::set_intersection( ancestor_theirs_differences.
m_changed.begin(), ancestor_theirs_differences.
m_changed.end(),
153 ancestor_ours_differences.
m_removed.begin(), ancestor_ours_differences.
m_removed.end(),
157 std::set_intersection( ancestor_ours_differences.
m_changed.begin(), ancestor_ours_differences.
m_changed.end(),
158 ancestor_theirs_differences.
m_changed.begin(), ancestor_theirs_differences.
m_changed.end(),
171 std::unique_ptr<BOARD> board;
175 board.reset(
static_cast<BOARD*
>( parser.
Parse() ) );
std::set< BOARD_ITEM *, CompareByUuid > BOARD_ITEM_SET
Set of BOARD_ITEMs ordered by UUID.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Information pertinent to a Pcbnew printed circuit board.
const BOARD_ITEM_SET GetItemSet()
A LINE_READER that reads from an open file.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
std::set< BOARD_ITEM * > both_modified
void findSetDifferences(const BOARD_ITEM_SET &aAncestorSet, const BOARD_ITEM_SET &aOtherSet, std::vector< BOARD_ITEM * > &aAdded, std::vector< BOARD_ITEM * > &aRemoved, std::vector< BOARD_ITEM * > &aChanged)
git_merge_driver_source * m_mergeDriver
KIGIT_PCB_MERGE_DIFFERENCES compareBoards(BOARD *aAncestor, BOARD *aOther)
std::set< BOARD_ITEM * > they_modified_we_deleted
std::set< BOARD_ITEM * > we_modified_they_deleted
Read a Pcbnew s-expression formatted LINE_READER object and returns the appropriate BOARD_ITEM object...
std::unique_ptr< BOARD > readBoard(wxString &aFilename)
Pcbnew s-expression file format parser definition.
std::vector< BOARD_ITEM * > m_removed
std::vector< BOARD_ITEM * > m_changed
std::vector< BOARD_ITEM * > m_added