Reviewing File Versions in ClearCase

(This blog entry is part of a
series of entries describing some of the new features in Code
Collaborator v6.0. The series content is listed in this entry.)

When I talk to customers or prospective customers who use ClearCase the
first question I always ask them is: “Are you using base ClearCase or
ClearCase UCM?”  The answer is important because it determines the features available in the integration that our peer code review tool, Code Collaborator, provides for ClearCase users. 

Most folks who are using ClearCase UCM tend to create code reviews based on a UCM Activity.  So we have full support for doing that from our cross-platform GUI, our command line interface (CLI), and our Visual Studio Add-in.

If, on the other hand, you are using base ClearCase, the situation is a bit different because Activities aren’t available to use as a change list.  Our integration makes it easy to add locally modified files to a code review, but that’s only useful if you want to do the review before checking in the files to ClearCase.

In an environment where code is reviewed after check in, the model we frequently see is that the check in was done on a specific branch.  So what you would want to be able to do is create a code review based on the changes made since that specific branch was created.  Or, another common approach is to create a review based on the differences between the contents of the specific branch and the branch into which the changes are about to be merged.

Unfortunately, our integration does not have support for creating a code review based on the differences between two branches (or labels, or anything else) in ClearCase.  The reason is that the file diff output from ClearCase’s cleartool utility is, quite frankly, not very useful.  There is not enough context information in it to create a useful display within our file comparison utility.  (Side note: in our integrations with version control tools that do provide adequate file diff information, Code Collaborator does allow creating a review based on the differences between branches, dates, tags, etc.)

The solution we provided was support for adding specific versions of files from base ClearCase to a review.  That solution existed prior to v6.0, but was limited to an addversions command in our CLI – useful, but not as user friendly as we would like.

As a result, the ability to add specific ClearCase file versions with our cross-platform GUI has frequently been at the top of the voting out on our user feedback forum.  I’m happy to announce that beginning with v6.0 the feature is now available in our cross-platform GUI:

AddVersions

You pick the files that you want and then the cross-platform GUI displays those files followed by two columns: “After” and “Before.”  You have to fill in something for the After column – it’s the only way Code Collaborator will know what version you want reviewed.  The Before column is optional.  If you don’t specify anything then we’ll ask cleartool for the predecessor to the After version of the file.

Filling in version strings for a large list of files can be tedious, so there are some controls that expedite the process.  Under the list of files there are two Autofill controls, one for After and one for Before.  In addition, the After Autofill has a predefined value that you can select: local.

Local

We use “local” to refer to, well… the locally checked out or sync’ed version of the file.  For example, if the local file hello.c is checked out from /main/9 then specifying “/main/9″ as the After version is the same as specifying “local.”

As an example, I created a branch called TASK_1 and I have made some changes to each of the files on that branch – as shown in the ClearCase Explorer: 

Cce

To create a code review that shows the differences between the selected files on the TASK_1 branch and the versions of those files that were used to create the TASK_1 branch, I would specify “local” and “/main/TASK_1/0″ :

Task1-0

If, however, I plan to merge TASK_1 back into /main and I want a review that shows the differences between TASK_1 and the current contents of /main I would specify “local” and “/main/LATEST” :

Main-latest

For me, this feature totally rocks because it makes it so much easier to demonstrate the value of Code Collaborator in a base ClearCase environment.  But what matters is: how well does this work in the real world?  If you have feedback, please leave a comment or drop us a line at support at smartbear dot com.

 

Speak Your Mind

*