Comparing to the Latest Accepted Revision of a File
Develop | Posted June 01, 2010

(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.)

As a code review tool, one of the features that Code Collaborator has to support is iterative reviews. That just means if the author of a file being reviewed uploads a newer revision of that file the right stuff should happen, where "right stuff" includes:

  • Sending out appropriate notifications to review participants
  • Recording the new revision and displaying it in the review
  • Moving comments/defects if the line number they are associated with has changed as a result of lines being added/removed from the file

As a review participant, when a new revision of a file has been uploaded, you typically want to see that newest revision compared to the previous upload of the file. That way you can easily see just the most recent proposed changes to the file.

If, however, you have not been "keeping up" with the multiple revisions as the author has uploaded them, you would probably prefer instead to see a comparison of the latest revision to the original version of the file. That way you would see all the proposed changes highlighted.

Code Collaborator has a preference setting that controls which comparison you initially see when you open the diff window in our browser UI:


Further, of course, you always have complete control over which two revisions are displayed in the diff window, via the Compare selector on the tool bar:


In the example above, there are five entries: the base version of the file (r62 from the source control system) and four different revisions that have been uploaded during the course of the review. Clicking the Show button with the above selection would display the first proposed revision on the left hand side of the diff window and the second proposed revision on the right hand side of the diff window.

That's all fine and well, but it's not enough. If you participate in a review for a while and then stop participating, if multiple revisions of a file get uploaded while you're away, which way should you set the display preference?

If you set it to have the diff viewer open up with the latest revision compared to the base version, you'll see changes highlighted that you have already reviewed. If, on the other hand, you set the preference to compare the two most recent revisions, then there will be proposed changes that are not highlighted that you have not reviewed yet.

With v6.0 of Code Collaborator, there's a new option available:


If you set the preference to Current vs. latest Accepted, then the diff window will search for the latest revision that you "accepted" and compare that revision to the latest upload.

To understand how that works, you have to be familiar with the Accept feature. It is kind of an odd feature because semantically, Code Collaborator does not assign any meaning to it. It is just a handy way for you to keep track of your progress as you work through a review.

At the top of the chat pane in the diff window, there is always an entry labeled "Overall" which is for comments/defects that apply to the overall file, instead of to a specific line. There is an Accept button:


When you click the Accept button on the Overall entry, Code Collaborator looks at the two revisions that are being displayed and saves the latest revision. If you have the preference set to Current vs. latest Accepted, then the next time you open that file in the diff window, Code Collaborator will compare that accepted revision and the latest upload. If you have not accepted any revision of the file, then it will fall back to comparing the base version to the latest revision.

There is also a visual cue in the Compare selector; the green (instead of blue) circle indicates that the second revision to the file was a revision that was accepted:


If you are new to iterative code review, you might be thinking: is this really that big of a deal? For many Code Collaborator users, it certainly is - the feature request got many votes on our feedback forum.

If you have feedback on this feature, please leave a comment or add it to our feedback forum.