Main Content

Resolve Conflicts in Projects Using System Composer Three-Way Merge Tool

This example shows how to use the System Composer Three-Way Merge Tool to investigate and resolve conflicts in System Composer™ architecture models in a project. You can view and merge the System Composer architecture model differences in the resulting report.

The Merge tool automatically merges non-conflicting changes before you open the merge report. This example demonstrates how to:

  • Review the automatic merge choices.

  • Apply your desired edits to the target file.

  • Decide how to resolve any remaining differences.

After you resolve the conflicts, you can commit the resolved architecture to source control.

System Composer Architecture Changes and Conflicts

The example project, RobotArchitectureProject, is under Git™ source control. When you attempt to merge the changes of a colleague on the main Git branch into your taskBranch, the operation results in conflicts.

To resolve the conflicts using the Three-Way Merge tool, examine your local file (Mine, in this example, the taskBranch branch), the conflicting revision (Theirs, in this example, the main branch), and the common ancestor of these two files (Base).

  • Theirs - A colleague, working on the main branch, updated the Motion component and updated the query used in the Component View view.

  • Mine - You updated the name of the Motion component and updated the query in the Component View view on the taskBranch branch.

Open System Composer Three-Way Merge Tool

In the Project panel, look for conflicted files. The RobotArchitecture file shows a red warning icon in the source control column, which indicates a conflict.

To see a detailed report of conflicts, in the Source Control panel, in the Modified Files section, right-click the RobotArchitecture file and select View Conflicts.

Project View of the robot architecture project showing a conflict with the Robot Architecture model file.

View Changes

The Three-Way Merge tool shows the changes to the two System Composer architecture models that cause this file conflict.

  • The main, taskBranch, and Base panes show the differences between the conflicting revision, your revision, and the base ancestor of these files.

  • The Target pane shows the file into which you merge changes. The tool copies this temporary file into the project when you choose to accept the merged result.

  • The summary table in the bottom right corner shows that the merge tool automatically resolved nonconflicting differences. The table also shows that you must resolve the remaining changes.

Three-Way Merge tool report showing differences between Theirs, Base, and Mine revisions of the Robot Architecture model file.

You can visually examine individual differences in the architecture model files.

  1. To examine a difference, click a row in one of the trees. The Merge tool displays the change for each model in an editor, for example, the System Composer canvas, to the right of the Three-Way Merge window.

  2. On the Merge tab, in the Highlight section, choose the models to display by clicking Top Model or Bottom Model buttons.

Resolve Conflicts

The Merge tool automatically merges most nonconflicted differences before opening the Three-Way Merge report. In this example, you can see ten differences were automatically merged.

The Merge tool cannot resolve the conflicted differences. You must choose which design to keep in the target file in the Target tree.

To resolve conflicts, follow these steps.

1. Use the Next button to navigate to the conflict. The Name property is conflicted because you and your colleague changed it. In the Target pane, by default, the tool selects the change from your branch taskBranch Blue branch icon.

2. To resolve the conflict using the default selection, mark the conflict as resolved. In the Target pane, click the conflict icon in the Name row and click Mark as Resolved.

3. On the toolstrip, use the Next button to review the next conflict. The Component View view is conflicted because you and your colleague changed the color and the query of the view.

  • For the Color property of the Component View, if you want to keep the change from the base revision, select the option button in the base Orange branch icon.column.

  • For the Component Selection Query property of the Component View, if you want to keep the change from the main branch, select the option button in the main branch column.

A conflict with the Architecture View Color and Component Selection Query properties. In the tree, the Base change is selected for the Color property and the Mine change is selected for the Component Selection Query property.

4. On the toolstrip, use the Next button to navigate to the next conflict. The Motion Component is conflicted in the Component View view because you and your colleague changed the component name of the Motion component and this change propagated to the view.

  • To stay consistent with the change you selected previously, select the option button in the taskBranch branch column .

5. Check the summary table to verify you resolved all conflicts.

In this example, the summary table shows that you have successfully resolved all conflicts.

Panel of the Three-Way Merge tool displaying metrics: 5 resolved conflicts and 10 automatically resolved changes.

If you resolve all conflicts in the current view but the summary table title indicates that you have remaining changes, disable the filters to view and resolve the remaining conflicts. On the Merge tab, in the Filter section, turn the filters off.

Accept Changes

1. After you resolve all filtered and unfiltered changes, click Accept & Close. The Merge tool closes the report and the models, accepts the merge result in targetFile, and marks the conflict as resolved in the source control tool.

2. Before you commit the resolved model file to source control, perform a final review by comparing the merge changes against the current branch.

In the project Source Control view, right-click the model and select View Changes.

The Source Control panel displaying the RobotArchitecture model as a modified file. The right-click menu shows the 'View Changes' option.

See Also

| |

Topics