Diff

The Diff tool provides a visual display of differences between two files or two schemas in either a single or dual pane view.


This figure is a screenshot of the Diff tool dual pane view showing two files, side-by-side for comparison.

Figure 1. Comparing files (dual pane view)

Display modes

Code Editor can display files in different diff display modes. This mode has no effect when comparing two files on disk (dual pane will always be opened in this case). Change the display mode from the Diff menu.

No diff
Open in normal editing mode.
Single pane
Differences appear in a single document.
Single pane with deleted blocks
Differences appear in a single document with deleted blocks highlighted.
Dual pane
Open in two panes with read-only reference (base file) and editable open document.

Colors indicate the differences in the files. The default colors can be changed in preferences.

Red
Deleted line.
Orange
Modified line.
Green
Added line.
Gray
Line placeholder.

Navigate the differences

Use the diff toolbar or right-click context menu to navigate through the differences in the files. Options include Switch to single or dual pane view, Go to first/last difference, Go to previous/next difference, Copy change to left/right, Copy all changes to left/right, Create patch, and Flip sides.

The Diff base file

When a file is opened in Code Editor, it is opened in diff mode with a base file set for you. However, you can change the base file used with Diff >> Base File. 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.

Comparing schemas

The diff produces a schema containing all the changes to make to migrate from a reference schema to a user schema.

Compare files with external tool

You can specify an external tool instead of the integrated one to compare files in preferences. The Tools >> Diff 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.