Comparing SourceSafe Labels to Team Foundation Server Labels
A colleague recently asked me how to find labels in Team System. I never used labels much, even in the bad old days of SourceSafe, so I did some exploring. What's a label?
A label is a marker that you can attach selectively to a set of otherwise unrelated files and folders in your source control server to facilitate their collective retrieval to a workspace for either development or build purposes.
To add a label, right click a file or folder in Team Explorer and choose the Apply Label command. That results in the following dialog:
Once you've applied the label, it's hard to find them again in the UI. Try File, Source Control, Label, Find Label:
If you're used to the Visual SourceSafe label model, you may be in for a shock-- Team System labels are very different animals. Brian Harry elaborates:
The difference with SourceSafe is that [labels] are not included in the history. There’s a good reason for this. Labels in SourceSafe were always “point in time” labels. You generally labeled some tree at some point in time and that implied a label of all of the contents of the tree at the same point in time. In this respect it is reasonable to display labels in time sequence with history. Everything before it in the list is in the label and everything after it is not. This works for a significant percentage of label uses (and is a convenient way to think of them) but not all.
In Team Foundation, labels are more powerful. Instead of being a single point in time, they are able to have versions of each file in the label from different points in time. The canonical scenario is that you label a build and then find some bugs and want to go back change the versions of a few of the files (either omitting changes that introduced bugs or adding changes that fixed bugs). Now the label does not represent a point in time, but rather a collection of points in time. This makes it very hard to display it in a list mixed with change sets because there is not “correct” ordering of the list. As a result, [in Team Foundation Server] we treat the list of changesets and the list of labels separately.
In other words, Team System labels represent a specific set of files at a specific version-- but nothing else.