1

So in a typical workflow of a developer, it goes something like this:

You sync your workspace to some changeset, do some work, shelve changes you've made.

My question is, internally, when you create a shelveset, does TFS keep track of which changeset the changes are based on? If so, is there a way to look this up?

My rudimentary understanding is that, yes, this changeset information must be somehow recorded because shelvesets are stored internally as delta's, as opposed to full copies of files and without a record of which changeset the delta is based on, a delta is basically useless.

igbgotiz
  • 892
  • 1
  • 8
  • 28
  • How are you trying to discover this information? The SDK? Command-line? Visual Studio? Are you trying to examine this information on the server, or from an unshelved shelveset? – Edward Thomson Sep 24 '15 at 15:03

2 Answers2

1

That may be a typical workflow for your team, but I'd say that it's not a typical workflow in general.

Shelvesets are intended for short-term suspension of work in progress that's not quite ready to be committed to a dev branch, generally in the case of something exceptional occurring that requires immediately switching contexts (e.g. troubleshooting or fixing a bug).

Internally, TFS actually stores most files as reverse deltas. Why? Probably because the most frequently accessed state of a file is the current version, and having to "build" the current version by playing forward a series of changes to the originally file is going to be a lot more expensive. Basically, when you go to look at an old version of a file, it takes the current version of the file and "peels off" the intervening changes until it's back at the old version.

Your specific question is actually directly addressed:

Shelvesets also use the same mechanism for storing their content. However, with shelvesets, no deltafication happens. Each shelveset gets a new copy of its file(s). (except in the case of a merge). When a shelveset is checked-in, a shallow copy occurs and the committed version of a file uses the same content as the shelveset copy of the file referenced. Deltafication will be started on the previous version of the file(s).

So, long story short, shelvesets are not based on changesets.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
  • I think that the bigger question is how to understand the base version of a file in a shelveset (ie, the workspace version that was modified to create the shelveset) and that the delta conversation was a distraction and a theoretical musing about how a base must exist. It does, of course, but indeed deltas have nothing to do with it. – Edward Thomson Sep 24 '15 at 15:02
  • @EdwardThomson I agree, this is probably an X-Y problem, but the question that was asked was perfectly answerable as written, so I didn't dive deeper. :) – Daniel Mann Sep 24 '15 at 15:09
0

I concur with Daniel's answer that the files of a Shelveset are copies of new files. However, I'm not sure when this was incorporated but currently in VS2017 the Changeset is actually stored. When looking at the Shelveset Details if you hover your curser over a file among the details displayed for the file is the "Version" it is based off of.

Example Image

I don't know how useful this will be for the typical user as I have found one of the best features of Shelvesets is the modularity and separation from the version control but it never hurts to have that context.

Cheers!

Nathanael Istre
  • 101
  • 1
  • 4