How to get the correct Version when unshelving older Shelvesets in TFS?

1.2k views Asked by At

I just wanted to unshelve a shelveset which has been added some days ago. Meanwhile, somebody else has successfully checked in new versions of files contained in the shelveset. As there exists a conflict in my files between the latest version and the shelveset (because it has another base changeset), i want to revert my code base to a this specific version used by the shelveset.

How can i now determine, which base version of the shelveset has been used? Unfortunatelly, there is no information about this in the "Details" - Information of the shelveset.

2

There are 2 answers

0
Edward Thomson On

You can view the version of the shelved change in the shelveset details dialog - if you right click on a file, you can select "Properties" which will show you the shelved version and latest version.

However, unshelve will not pend new changes against the latest version - it will check out against the shelved version instead. Imagine this scenario:

You pend a change against $/A at version 5. You create a shelveset foo and undo your local pending changes.

Another user checks in a new version of $/A. You get latest, and now your $/A is updated to version 6.

If you were to then unshelve foo, since the shelved pending change was version 5, you will now have a pending change at version 5. If you get latest, you will have a version conflict and be able to resolve the conflict to bring your pending changes up to version 6.

0
pantelif On

I don't think that's possible.
Even if you get with TFS-SDK a Shelveset using VersionControlServer.QueryShelvesets, there nothing in that direction.

That's actually making sense, since a Shelveset might contain items from multiple branches, folders, even Team Projects - so there isn't always a "one-to-one" relationshiop between a changeset & a changeset.

In your place, I would simply add the info in the comment (by hand: ugly but it 'll work)