Reviewing a Subset of a Subversion Revision

  December 04, 2008

When you use Code Collaborator with Subversion it is easy enough to do a post-commit review of all the files in a revision of the Subversion repository. With the command line specify ccollab addchangelist, with the GUI click the Add Revisions button, or with the Eclipse plugin right-click the revision in the History window and then select Add to Review from the context menu.



Code Collaborator will add all the files to the code review from the commit that created that revision. But what if you only want to review some of the files that were committed in that revision? You have two options.



Option one is to add the specific differences for the files that you want to review. To do this on the command line use ccollab addsvndiffs; with the GUI click the Add Subversion Diffs button and then use the Revisions tab. This feature is not currently supported in the Eclipse plugin. There are two downsides to this approach. The first is that it is more complicated - you will have to specify the exact Subversion diff options in order to extract the correct files. The second is that since the input to Code Collaborator came from Subversion's diff command, there is no way for Code Collaborator to know the revision numbers associated with the different versions of each file that get uploaded. So in the Code Collaborator diff viewer, the version information displayed is not very helpful, for example:





Option two is to go ahead and create the review with all the files that were modified in the revision. In other words, use ccollab addchangelist (or one of the other methods described above). Then use the Notes feature of the Review Summary Screen to indicate which file(s) should actually be reviewed (or, alternatively, which should be skipped):



Notenote



In addition to being easier to create, this review has the advantage of including revision information for each file, which is displayed in the diff viewer:



V14v16



You might be wondering... why not provide a file chooser that would allow you to pick just the files you want from the commit that was done to create the revision? That's a possible enhancement, but it would potentially cause confusion because the annotation that Code Collaborator provides in the Review Materials section would no longer be accurate:



Revisioncomment



The revision number (16) and the comment ("Changes needed for i18n") came from Subversion. In other words, that comment was specified by the user when revision 16 was created and the implication is that all files for that revision are shown in the list. If the author of the review were allowed to pick and choose only some of the files, then a reviewer could easily get confused about the contents of the commit.