Compare editor
You can view the differences between two resources by comparing them. You can compare the design of all the entity types, or the source code of Macros. You can compare two versions of the same instance, or two instances. When a common ancestor exists, you can compare three resources.
When the comparison is complete, the default compare editor opens in the editor area. For all the entities except Macros, the default compare editor (Design content compare) compares the structure and the design of the instances. For Macros, the default compare editor (Macro source compare) compares the COBOL source of Macros from a textual angle.
Changes are computed relatively to the reference source, which determines the direction of the comparison.
- The Structural changes view displays the summary of all the changes that were detected by the compare process. It contains one line for each change and indicates the nature of each change.
- The detail view displays the elements of each change that is selected
in the Structural changes view. It is constituted
of two parts: the compared resource in the left part and the reference
resource in the right part.
- For a design comparison, this view displays by default the instance composition, that is to say all the instances it calls. You can also display the instance attributes, most of which come from the instance Definition.
- For a comparison on the Macro source code, this view displays the source codes that are compared from a textual angle.
Toolbar
- Switch the compare viewer:According to the content type, the system determines which compare viewer is the best for the comparison. You can select other viewers in the drop-down list. The two viewers to be used for Rational® Programming Patterns are the following ones:
- Design content compare for all the entities other than Macros,
- Macro source compare for Macros.
- Show the attributes
:
This action is available for a design comparison. It is used to display the changes carried out in the instance attributes.
- Show composition
:
This action is available for a design comparison. It is used to display the changes carried out in the calls of instances.
- Swap the reference instance and the compared instance in the editor
:
In a comparison between instances, you can swap the reference instance, relatively to which the comparison is carried out, and the compared instance. By default, the reference instance is the second instance in the alphabetical order. However, you might need to compare the instances by taking the first instance as the reference. In this case, you must swap the two instances.
- Show or hide the ancestor pane
:
With this action, you can perform a three-way comparison. It is useful to compare a conflicting file or a file to be merged. In both cases, a common ancestor is automatically searched for. By default, the ancestor pane is hidden.
- Copy all the changes to the reference instance (to the right)
:
This action is available for a comparison between two instances. It copies the entire contents of the compared instance into the reference instance. Both contents are then identical.
This action is not available for a comparison in the history because in this case, the reference version is in a read-only mode.
- Copy all the changes from the reference instance to the compared
instance (to the left)
:
This action is always available, whatever the comparison type is. It copies the entire contents of the reference instance into the compared instance. Both contents are then identical.
- Copy the current change to the reference instance (to the right)
:
This action merges the changes by copying the change that is selected in the compared instance into the fragment that is selected in the reference instance. The selected fragment is overwritten in the reference instance.
This action is not available for a comparison in the history because in this case, the reference version is in a read-only mode.
- Copy the current change to the compared instance (to the left)
:
This action merges the changes by copying the change that is selected in the reference instance into the fragment that is selected in the compared instance. The selected fragment is overwritten in the compared instance.
- Select the next change
:
This action highlights the next change that is detected by the comparison.
- Select the previous change
:
This action highlights the previous change that is detected by the comparison.
- Select the next difference
:
This action highlights the next difference that is detected by the comparison. It is available for a comparison on the Macro source code only.
A change is a portion of text that was modified within the line. A difference is a section of file that consists of one or more lines, and that can contain many changes.
- Select the previous difference
:
This action highlights the previous difference that is detected by the comparison. It is available for a comparison on the Macro source code only.
A change is a portion of text that was modified within the line. A difference is a section of file that consists of one or more lines, and that can contain many changes.