Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View history with Visual Studio shelvesets

Tags:

tfs

Is it possible to view history and compare with shelvesets? We are investigating the possibility of using shelvesets instead of check-ins. From our initial investigation it seems we cannot view history like we do for check-ins.

We are using Visual Studio 2010/TFS 2010.

like image 817
Richard Butterwood Avatar asked Oct 02 '12 20:10

Richard Butterwood


People also ask

How do I open changeset in Visual Studio?

In Source Control Explorer, press Ctrl + G. The Go to Changeset dialog box appears. Type the number of the changeset and choose OK.

How do you Unshelve a Shelveset in Visual Studio?

To unshelve the shelveset from someone else you go to Team Explorer -> Pending Changes. You then select the Action link next to Shelve and select Find Shelvesets. By default, you'll now see the shelvesets that are found for your user account.

How do I get a specific changeset in TFS?

Take searching for a changeset in Visual Studio's TFS Source Explorer. Luckily if super easy to do! When you're in the Source Explorer, simply press Ctrl + G and the Find ChangeSet dialog will appear.


3 Answers

From http://msdn.microsoft.com/en-us/library/ms181403(v=vs.90).aspx

Section: The Difference Between Changesets and Shelvesets:

Unlike a changeset, a shelveset is a non-versioned entity. If you or another user unshelve the items of which a shelveset consists, edit several files, and reshelve the shelveset, Team Foundation does not create a new version of the items for future comparison and maintains no record of who revised the items, when, or in what manner. The original shelveset is completely replaced.

So, no, you can't review history. I am unsure on methods of comparing shelvesets. You should also read that entire section (The Difference Between Changesets and Shelvesets) as each item in it is a strong argument to not use shelvesets in the place of changesets.

I also cannot think of any reason why using shelvesets instead of changesets would be desirable, maybe you can list the reasons why you all were exploring this path. Just think about not being able to track changes, that alone should be a deal breaker (of course, shelvesets not even being versioned should just about do it)..

like image 68
dugas Avatar answered Nov 15 '22 13:11

dugas


Like it says on the link posted by dugas, shelvesets are built more for...well, shelving things. For example, on the project I am working on right now, I did a shelveset for some refactoring changes I was in the middle of because something unrelated broke and I needed the code back to the original non error-filled version. I also use it for when I'm in the middle of attempting something and want to have a backup but I don't want to check in code just yet.

like image 21
Dillon Welch Avatar answered Nov 15 '22 12:11

Dillon Welch


There's no versioning on shelvesets, but it is possible to compare code in a workspace, to the code in a shelveset, without pulling the shelveset files.

  1. Pull the versions of files you want to compare the shelveset contents to, into a workspace
  2. open the solution in that workspace
  3. File >> Source Control >> Unshelve Pending Changes...
  4. find the desired shelveset and bring up its details
  5. On each file in the Shelveset Details window, you can right-click and select Compare >> With Workspace Version...

TFS will pull the shelveset file to a temporary location, show the diff, and then (?) clean up the temp file after you're done.

You'll be comparing the shelveset file contents, to the contents of the files on the local disk in this workspace. If changes were made to both files, the compare won't be able to tell and will indicate all those changes. However, you can compare the selveset version to its original (Compare >> With Unmodified Version..), to see all the changes that were made just to the shelveset file. You can also find out the changeset that was the base for the shelveset file (Properties..), and see what changes were added to the workspace version since that common base changeset.

There's no tree compare though, and this may require the TFS power tools to work.

P.S> I don't recomment trying to use shelvesets in place of checkins like this. If there's one thing I've learned over the years, it's not to fight Microsoft's designed-in workflows -- you do things their way, or you find a different tool. Microsoft doesn't intend you to use shelvesets this way (they want you to use changesets and a branch), and if you try, you'll constantly be fighting Microsoft's designed-in workflow.

like image 34
patbob Avatar answered Nov 15 '22 13:11

patbob