tags:

views:

1144

answers:

5

When viewing files in a shelveset, I would like the option of comparing the files to my current local version. Unfortunately, the only options available are "With Unmodified", "With Workspace" (I guess this one would be the answer, if it wasn't disabled) and "With Latest".

Any ideas?

A: 

I don't think that it is possible to compare a shelved version with a local version in Visual Studio, however I'll be very happily corrected on the matter.

Martin Woodward
+1  A: 

Although this isn't the ideal way to do it, depending on your comparison tool you may be able to tell it to compare the shelved version to a local version (workspace). I use Beyond Compare, and this allows you to open a file to compare to. So from the shelveset I do a compare to Latest, and then replace the 'latest' with my local workspace version.

Unfortunately I've just checked the built in comparison tool and it doesn't provide this option.

Alex McMahon
A: 

I have been looking for a way to do this for quite some time. I wonder how hard it would be to create a vs.net plugin to do this for you.

+1  A: 

This is a little laborious but it does the job:

  1. Right click any file in Solution Explorer and select 'Unshelve Pending Changes...' from the context menu.

  2. Double click the relevant shelveset in the Unshelve dialog.

  3. Double click the file that you want to compare. This will open the sheleveset version of the file in notepad.

  4. Save the file somewhere on your local machine.

  5. Close all the dialogs.

  6. Right click the local workspace version of your file in Solution Explorer and select 'Compare' from the context menu.

  7. Change the target path to that of the file that you saved earlier and click OK.

lexx
I don't think this is correct. Just tried with tfpt2008 and the review option only compares with previous or latest.
TheSean
I'm sorry to say that you are right TheSean. Looks like I made a mistake on this one. I will edit my answer accordingly.
lexx
Thanks for pointing out my mistake TheSean. Hopefully my new answer should do the job even if it is a bit of a long process just to compare two files.
lexx
A: 

Here's a simple hack that works:

  1. Click on 'Unshelve'
  2. Select proper shelveset
  3. Click on the 'Details' button
  4. Right click on the file you wish to compare
  5. Click on 'View'
  6. This opens up in your text editor, save it to your desktop or wherever you like.
  7. Open your file diff program and compare the saved version to your local version.

In a nutshell, save a copy of the shelved version you retrieve from the server and just do a manual compare using your diff tool.

TJB