June 3, 2008

Differences Between Builds/Releases

Surround SCM
The ability to view differences between builds or releases is key when a new build or release introduces a new bug or issue. With Surround SCM, you can use branch differences to achieve this. The only prerequisite is that you use snapshots to capture your builds or releases. If you are not sure which is the better approach between labels and snapshot branches, the Labels vs. Snapshots article explains the differences. [toc]

What is branch differences?

Branch differences allows you to view the differences between any two branches under a mainline that share the same repositories. You can choose a specific file, or you can create a differences report, and see what is different for each file between the branches. Figure 1 shows the branch differences window with two snapshots branches side by side.
Figure 1- Branch differences

How do I use branch differences?

To use branch differences, right-click on one of the branches and select "Branch Differences". You will be prompted to select the branch to diff against. Note that you will only see branches that have the same repositories. For example, if you choose a baseline that has its root repository as "WysiCorp/WysiCalc", you cannot view differences against another branch that has a root repository of "WysiCorp/WisyChart". Note: You can also select "Branch Differences..." from the "Branch" menu and also from the repository context menu.

Which features help see the differences between builds/releases?

The graphical view of the two branches side-by-side allows you to easily see which files are different and which files and/or repositories may be in one branch but not the other. If you compare two snapshot branches that represent builds or releases, you can now see what was different between these builds/releases.

View differences for a file

Select a file and double-click it to start the differences utility. This will show you the actual differences for the selected file between the branches.

Generate a differences report

You can generate a differences report and have it list the differences for each file that is different. This provides a comprehensive look each difference that exists between the branches.

What else can I do with branch differences?

There are other useful features in branch differences that give you a lot of power when using branches.

Copy files

This allows you to take a file in one branch and replace the corresponding file in the other branch.

Merge files

You can take any file and merge it. This means you can take any file from any branch and merge it with the same file in another branch. You could use branch differences compare your workspace branch with a development branch, then merge your changes without having to promote your changes to a branch. Figure 2 shows a workspace branch being compared against a "sibling" branch. Note that "Copy" and "Merge" are available but not "Promote" and "Rebase". This is because the two branches are not in a parent/child relationship.
Figure 2 - Workspace compared against a baseline branch


If you are viewing differences against two branches that are in a parent/child relationship, you can also perform promotes and rebases from branch differences. This allows you to see the branches side-by-side and choose which files to promote.

What if I prefer to use labels?

If you use labels to capture builds and/or releases, you can also view differences between labels. Note that this feature is only available in Surround SCM 2009 and later. Select Tools > Labels.
Figure 3 - Labels dialog
Select the two labels you want to compare and select Differences.
Figure 4 - Label Differences dialog
Check boxes are provided at the bottom to filter the view. For example, check only the "Show files with different versions" to only see those files that are different between the labels. The one advantage of using labels is that the label differences window shows you which version of the file(s) was part of the build/release.