The Diff tool compares two files: a read-only base copy
of the file and a working copy. It is integrated into Code Editor.
Comparing files
The Diff tool automatically selects the Diff base file and
flags differences between the base file and the working copy with color-coded markups in the Code
Editor gutter. Colors can be changed in
preferences.
- Green - added lines
- Orange - modified lines
- Red - deleted lines
The base file is selected in this order:
- Use Generated File
- The default for generated files, this option compares the document with the file generated by
the application generator. This is the generated file before POINTs and BLOCKs are injected into the
file. This option is made available only if the file has been generated.
- Use Repository File
- The default for versioned files, this option compares the document with the file in the
repository for the current SVN version of the file. This option is enabled only if the file is
versioned.
- Use File on Disk
- Compares the document with the contents of the file as it was on disk when the file was opened.
If you select this option again after the file has been opened, the diff data will be refreshed by
comparing the document with the actual content of the file on disk.
You can change the base file used with .
Specify how the tool compares white space and case in preferences.
Display modes
You can select a Diff display mode from the menu.
- Normal View
- This view opens the file in normal editing mode.
- Diff View
- This view displays differences between the base file and working copy in a single pane document.
This is also called single pane diff mode. New and modified lines are clearly marked by
color. This view identifies the location of deleted lines, but does not display them.
- Diff View with Deleted Blocks
- This view displays differences between the base file and working copy in a single pane document
with deleted blocks highlighted in red.
- Vertical Dual Diff View
- This view displays the two files vertically, with a left and right pane. It opens the base file
(read-only) in the left pane and the editable working copy in the right pane. This is also called
two pane diff mode.
- Horizontal Dual Diff View
- This view displays the two files horizontally, with a top and bottom pane. It opens the base
file (read-only) in the top pane and the editable working copy in the bottom pane. This is also
called two pane diff mode.
Example: Diff View
This figure shows Diff View. Lines 28-32 are marked with green blocks to
indicate newly added lines. The orange block in the gutter of line 24 indicates a modified line (a
new comment, highlighted in green, has been added to the existing line). The red line between line
22 and line 23 flag the location of a deleted line/lines.
Figure 1. Diff View display mode
Example: Vertical Dual Diff View
This figure shows Vertical
Dual Diff View. Side-by-side comparison of the base file in the left pane and the
editable working copy in the right pane give you a before and after record of changes. Red blocks in
the gutter of the base file pane show the contents of lines deleted in the working copy.
Figure 2. Vertical Dual Diff View display mode
Diff navigation
Locate the changes quickly with Diff navigation options.
- First Difference
- Locate the first difference.
- Previous Difference
- Locate the previous difference.
- Next Difference
- Locate the next difference.
- Last Difference
- Locate the last difference.
Reverting a difference
To revert a difference, place the cursor in the line of marked code that you want to revert.
Select Diff >> Copy to Right. The action replaces the difference in the working copy with the original values from the
base copy. Select to Right to revert all changes.
Use an external tool
You can specify an external tool instead of the
integrated one to compare files in
preferences. The option will launch the external tool.
Command line option
Use generostudio
-diff file1 file2 at the command line to open the
given files in Diff mode.