Tip for doing code reviews with TFS Shelvesets

A common complaint when doing code reviews with TFS is that people think they have to Unshelve the shelveset to review the code. They really want to see what changed in a file that is being checked in and they can’t find a way to do it. They typically wind up unshelving the shelveset and reviewing each entire file contained in the shelveset.

 

There is actually a way to view individual files from a shelveset or to compare an edited file with another version.

 

In the Unshelve dialog box, either select the shelvest and click Details or double click the shelveset name. This will bring up the Shelveset Details form. In this form, you can:

 

  1. Double click on a file name to open it in Notepad
  2. Select a file and click one of the icons in the tool bar. There are icons which will open the file in Notepad or compare revisions of the file. For new files (i.e. those with a change status of add), the comparison icon is grayed out.
  3. Right click on a filename which will bring up a selection box. In this box, you can click View which select will open the file in Notepad or Compare and a file version with which you want to compare the file being code reviewed. For new files, you cannot select Compare because the file revisions to compare against are grayed out.

When comparing revisions of a file, the Unmodified and Latest versions are always available for files which were edited. If you have an edited version in your workspace, you can compare the changed file against your version too.

 

John D'Addamio