Thursday, July 06, 2006

Apply Label adventure

When one performs "Apply Label" on file or folder in TFS source control, the operation may lead to not entirely expected results.

Let us say that Bob has selected file $/Northwind/foo.cs, right-clicked it and chosen "Apply Label" menu. File is selected by default, thus Bob proceeds from "Choose Item Version" dialog to "Apply Label for foo.cs" dialog. There Bob specifies label name Test Label and hit OK. As was expected, new label is created with foo.cs contained.

But when Bob performs the same sequence for file $/Northwind/foo1.cs and specifies same label name, the file is added to existing label! User is not notified in any way that label already exists, and after operation is completed, Test Label contains two files, foo.cs and foo1.cs. More than that, if one would specify label name as tEST lABEL, TFS will still consider that to be same as Test Label.

While operation is called "Apply Label" and one may argue from the point of wording it does exactly that - applies label to the item versions selected (creating it only if needed), I believe that is the behavior to be aware of as inadvertently user may easily add items to existing label while believing that new label is being created (to say naught of case sensitivity in label names).


split55 said...

Would this still be true if the databases were case sensitive?

eugenez said...

I am not sure about "what" would be true; but I do have experience with case-sensitive version control system, and it was a royal pain! Any positive side to case-sensitivity is lost in effort spent on resolving confusion due to this very feature.
So from what I know, I am very happy that TFS version control is not case-sensitive.

Justin Collum said...

That's annoying. And I can't find a way to apply a label to multiple files at the same time. I think Sourcegear Vault has much better ways of organizing files.