5
votes

We are planning to move from StarTeam to TFS for source control and are in the midst of refining our ALM procedures. Maybe I am misunderstanding something about how labels work in TFS, but it appears that you can apply a label to files by Changeset. I am trying to create a label on only the files/versions in the specific changeset.

I have attempted to do this like so: 1) Main Menu -> Source Control -> Apply Label 2) 'New Label' dialog appears 3) Leave path as is (Dev Branch) 4) Select 'Changeset' from 'Version' dropdown, enter my changeset # 5) Click Create.

... which results in the entire branch getting labeled. The changeset may be 1 - 100s of files, so individually labeling files is not practical.

We do this all the time in starteam: label changesets related to features, then move a build label up onto the labeled changeset. Am I missing something fundamental? (Thanks for any guidance)

2
It might be kludgy, but would a shelveset work for your scenario? It might not allow you to do everything you want, but it would keep a specific set of files in a specific known state, for historical purposes. Also, you might look at branching strategies that would facilitate what you want to accomplish.Merlyn Morgan-Graham
a shelveset would keep a group of files together but the changes are not applied to the real branch. That would be good if the purpose is to do a peer review prior to committing the changes or something like that.Beth Lang
Our purpose was to label for a build. The tricky part is that the label will no always be applied to the latest version of a file. Historically this is the way we have always done things in starteam due various constaints: no branching, multiple developers touching same files with varying deadlines. Were changing our approach with the conversion to TFS, utilizing branching/shelving so that we can essentially build from the latest version of all files.Nachiketa

2 Answers

5
votes

Note the name... you are labeling by changeset not labeling a changeset.

Labeling in TFS is like marking a point in time. So when you label by changeset you are basically saying this is what my source control looked like at this point in time.

It sounds more like you area saying you want to be able to find a set of changes (changeset) not everything at the point in time that changeset was made.

You could pick a branching strategy that would allow you to branch by feature. The downside of this is that it will involve a lot of merging.

Another options would be to link the changesets for any specific feature to a work item and then you will have a list of changesets that you will want to merge up once you have completed that feature. In 2008 this can be a little troublesome because merging changesets that are not sequential can be more time consuming than necessary. (meaning there are changesets in between on that branch not that the changeset numbers are sequential)

Fortunately, you can try out different branching strategies and as long as you think it through it isn't to tough to switch if you don't like how you were doing it.

0
votes

In TFS2010 I tested adding lables to a changeset and I am seeing the same behavior you reported.

When reviewing a changeset it will only contain the files that were checked in.

When reviewing a label that was created on the same changeset it will contain all of the files in the branch, with each file showing the changeset version of the last check-in.

I don't know why it works this way.