Viewing file differences

After you make changes to a file, but before you check it in, you may want to compare the file to the server copy and reconcile any differences. This process of diffing and merging is crucial when you use non-exclusive check outs.

You can diff files to compare, accept, or reject differences between two file versions. Suppose that you check out version 1 of a file non-exclusively to work on the spell check functionality. Jane checks out the same file version to work on the HTML conversion functionality. Jane checks in her changes before you do and Surround SCM updates the file to version 2. When you check in the file, Surround SCM sees that it is based on version 1, but the current server copy is now version 2. The server tries to automatically merge the files. If the auto-merge fails, you are prompted to perform a local merge to resolve the issues. See Merging files.

You can diff files at different points of the development process, such as when you are fixing bugs. For example, you fix a printing error in an application. Three weeks later, a customer reports another bug that seems to be related to the earlier printing issues. Since you made your changes, two other developers also made bug fixes to the same file. You can diff the current server version against the earlier versions to see exactly what changed with each bug fix.

You can annotate files to see specific changes made between file versions. The change, user who made the change, when the change was made, and the Surround SCM action that changed the file version are displayed. See Viewing line-by-line file changes.

1. Select the file and choose Activities > Differences.

The Differences dialog box opens. Read-only information is displayed in the File to Compare area.

2. Select a Version.

  • If you have the file checked out, you can use the version of the checked out file or the current server file. This helps you determine changes made to the file since checking it out.
  • If you do not have the file checked out, the current server file version is displayed and cannot be changed.

3. Select a Second File option.

  • Copy in working directory compares the server file with the working directory file.
  • Selected file compares the server file with a file you select on your local drive. Click Browse to select a file.

4. Click Advanced to select a branched file, historic file version, or unrelated file.

The Second File area expands with the following options:

  • Branched file compares the selected file to a branched version.
  • Historic version compares the current version to the selected historic version.
  • Unrelated file compares the file to any other file on the Surround SCM Server. Click Browse to select a file. See Merging unrelated files.

5. Click Differences.

The differences application opens.

You can change the application for diffing files. See Adding diff/merge applications.