38

Is there a way to compare 2 shelves in TFS without having to resort to unshelving both in separate workspaces and diffing the files?

koregan
  • 10,054
  • 4
  • 23
  • 36

3 Answers3

30

I was looking for the same i.e. to compare the contents of two shelveets without needing to unshelve one of them. End up writing a Visual Studio extension for the functionality.

The extension is available for Visual studio 2013

http://visualstudiogallery.msdn.microsoft.com/1fa59764-efc6-457a-a5f3-81ca68e280e8

and for Visual studio 2012

http://visualstudiogallery.msdn.microsoft.com/33c521d4-73fc-48be-969d-fa68c511341f

Please feel free to use and give your feedback.

Hamid Shahid
  • 4,486
  • 3
  • 32
  • 41
14

I don't have access to TFS currently, but if the file in the shelveset has a unique idenitifer (like say $/x/y/z/a.b.c;SH='ShelvesetName') you should be able to issue a command line tf dff command to compare each one.

Or

If you unshelve one and then use the command line TFS power tools to compare the other one with the review command

tfpt review /shelveset:shelvesetName;userName

The power tools are version specific and you can download the following versions:

Preet Sangha
  • 64,563
  • 18
  • 145
  • 216
  • 21
    The tfpt review command doesn't seem to be able to compare against your local disk. The Diff button gives you the changes from the original version, and Diff Latest gives you the changes from the latest version on the server. Neither is what the original questioner asked for. – Ian Goldby Feb 23 '12 at 15:19
  • 2
    Down voted because it says 'you should'. So it's a guess then? – Martin Capodici Apr 14 '13 at 23:26
  • 9
    The documentation states that you can only compare a shelveset to a server version, not your local files OR another shelveset. So unless someone proves that it works, both statements in this answer are wrong :/ – SvenS Jul 03 '13 at 09:18
  • The tfpt link seems dead. Can you try [this one](https://visualstudiogallery.msdn.microsoft.com/898a828a-af00-42c6-bbb2-530dc7b8f2e1/file/177107/1/tfpt.msi?SRC=VSIDE) and confirm? – aloisdg Jan 02 '17 at 14:55
  • Neither of these suggestions works. tfpt review cannot compare a shelveset to local changes, and tf diff cannot compare two shelvesets. – Aidan Ryan May 25 '17 at 14:22
  • The question was about a shelvesets and the what you originally had, but and not a shelfset and local changes. – Preet Sangha May 26 '17 at 22:28
  • As others have said, down-voted because `tf diff` only compares to server version, not local files, so for comparing two shelvesets, that options does not work. – John Chase Mar 14 '22 at 12:22
-1

In Visual Studio you can go to Team Explorer, Pending Changes, Actions - Find Shelvesets, then find your Shelveset, right click and View ShelveSet Details, you end up with a list of file, right click the one you're interested in and choose Compare with Workset.

SteveM
  • 99
  • 2
  • 9