Chapter 4. Obtaining Information About Files and Creating Patches

Watching Differences Between Revisions

There are several places in Cervisia where you can ask for a window showing the differences between revisions of a file:

  • In the main view, you can choose ViewDifference to Repository (BASE).... This is based on the command cvs diff and shows you the differences between the version in your sandbox and the version to which you last updated (also known as BASE). This is in particular useful just before you commit a file, so you can find an appropriate log message.

  • You can view the differences between the version in your sandbox and the version in the main development branch (also called HEAD) by choosing ViewDifference to Repository (HEAD)....

  • You can view the differences between the last two revisions of the selected file choosing ViewLast Change....

  • You can access the Difference to Repository (BASE)..., Difference to Repository (HEAD)... and Last Change... menu items from the main view context menu, by right-clicking the file you want to view.

  • In the dialog that is shown when a you commit a set of files, you can request a difference window by selecting a file name in the selection list, either by double-clicking it or by pressing Return. This is quite similar to using ViewDifference to Repository (BASE)... with the respective file in the main view.

  • In the Browse Logs dialog, you can mark two revisions of a file and request a dialog showing the differences between them (see the section called “Browsing CVS Logs”).

As you may have expected, Cervisia does not just dump the output of the diff command into your terminal, but shows you a graphical view as seen in Figure 4.1, “A screenshot of Cervisia's diff dialog”.

Figure 4.1. A screenshot of Cervisia's diff dialog

A screenshot of Cervisia's diff dialog

The text in the dialog is an improved variant of the text given by the diff command with the -u option. You can see the differing versions in two windows, with lines arranged such that you can do a side-by-side comparison. That means, where text has been added or deleted, the respective window shows empty lines with the marker +++++ at the left hand side. Elsewhere, you can see the running number of each line in the left column.

In the second column in the right window, you can see which kind of change has been made. Possible types are Add, Delete and Change. The respective lines are marked in blue, green and red color. In the middle of the dialog a compressed image of the color markers is shown. In this way, you can get a quick overview of the overall changes to the file. You can also use the position of the colored regions in the compressed image as an orientation when you using the scroll bars.

Normally, the scrollbars at the left and the right window are synchronized, i.e. if you scroll on the left hand side, the right hand side is scrolled by the same amount. You can change this by checking the box Synchronize scroll bars.

For information about how to customize the diff dialog, see the section called “Diff Viewer”.