Thursday 16 January 2014

Comparing two Shelvesets

Ever been in a situation where you have created a shelveset for a colleague to review or extend and he/she has created another shelveset for you. It’s often quite time consuming to find out the changes made on top of your shelved changes. The way to compare contents is to unshelve one of them and then compare the files in other with the workspace version of the files. This is not ideal especially if you have already got some other pending changes as well.

Since, neither Visual Studio nor Team Foundation Server Power Tools provides this functionality, I thought it would be useful to create a visual studio extension to allow comparing two shelvesets. Have been meaning to do it for some time but only found time to create one. The extension is now created and published in the visual studio gallery. I have made it an open source project and the source code is available at https://shelvesetcomparer.codeplex.com/.

Once installed the extension appear as a Navigation button in your Team Explorer window.

PreviewImage

Clicking on the button will open up the “Shelveset Comparer” window showing your shelvesets in the default view

clip_image001[7]_ca051aed-1e8f-4503-bfbd-2634176e8c95

You can type another person’s name to fetch his/her shelvesets. Once you have selected the two shelvesets, click the “Compare” button and it will list the files in the two shelvesets side-by-side. It also does a binary comparison of the common files to review if they have the same content or not.

clip_image002_14931e02-0615-43c7-9977-818103db3947

Double click on any file and you will see the contents of the selected files with the changes highlighted.

clip_image003_5e8cb8d5-2f58-47f0-88b6-56d54e6585f4

Please note that the file comparison is only for reference. None of the two files shown in the comparison window are downloaded in your workspace or is the working version of the file.

I hope this extension is useful for the developers community and am looking to hear back with your feedback and suggestion and of course if you want to contribute, please drop me a line. Happy coding!!

13 comments:

Unknown said...

This is great! Just what my colleagues and I are missing. Does it work with Visual Studio 2010? We have not yet upgraded to 2013...

Hamid said...

Thanks Nikolaj,

It's only supported for VS2012 and VS2013 only I am afraid. VS extensions are very different in VS2010 and I don't have plan to support it at the moment. If you have got access to VS2012 or VS2013, you can just use the team explorer and use the extension.

Sasha said...

Just installed for VS2012 and getting following message:

The "ShelvesetComparerePackage' dodn't install correctly.


ActivityLog.xml shows this on my machine

CreateInstance failed for package [ShelvesetComparerPackage]
Could not load file or assembly 'Microsoft.VisualStudio.Shell.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Hamid said...

Hi Sasha,
Thanks for reporting this. It was an error in the latest release. We consolidated code base for Visual Studio 2013 & Visual Studio 2012 version and missed out this reference.

The fixed is now available at
http://visualstudiogallery.msdn.microsoft.com/33c521d4-73fc-48be-969d-fa68c511341f

Please download it and let me know

Unknown said...

I use VS 2012 Professional edition and I do not see the "Compare Shelvesets" navigation link. Does it support only the premium version?

Hamid said...

Hi Raj,
The link would be with in the "My Work" section. Please see screenshot here

http://shelvesetcomparer.codeplex.com/

Unknown said...

My Work appears only when you have installed Visual Studio Premium or Visual Studio Ultimate.

I m using Professional edition.

Unknown said...
This comment has been removed by the author.
Hamid said...

Oh, you are right. That's a shame. I didn't realise that.

I will get another release out this weekend moving it to the Pending Changes section. Would that do?

Hamid said...

Hi Ravi,
I've updated the extension so that "Compare Shelveset" link appears in the Pending Changes. Please refresh the extension and you should be able to use it.

I hope it works well for you and please give your feedback:) Thanks

Unknown said...

Thanks Hamid. It works like a charm.

TomasK said...

It does not work when you need to select two shelvesets with different users. There is no possible to select the second shelveset. The second text box does not display the list of shelvesets.

I am using the Microsoft Visual Studio Premium 2013 - Version 12.0.31101.00 Update 4

Hamid said...

Hi TomasK,

If you go to Options tab, you would see the option "Select shelvesets from two users". Please make sure it is checked for you. I have the same version of Visual Studio and the version 1.4 of the extension works fine for me.