Listing all Labels attached to a file or folder
Team System has a great labelling facility. Unfortunately, however, there's no easy way to determine if a given file (foo.cs) or folder ($/myproject/) has labels attached to it.
When I posted a question about this on the official forums, we quickly determined that it wasn't possible out of the box. But Buck Hodges kindly pointed out a command-line code sample he posted last October which does exactly what we want!
Let's try it by passing in a file in our project, account.cs:
C:\Projects\WindowsFormsClient>LabelHistory account.cs
CI_20060706.1 (7/6/2006 3:34 PM)
CI_20060706.2 (7/6/2006 3:39 PM)
Label on just Account.cs (7/7/2006 10:49 AM)
Comment: test
As expected, we see all the labels that were ever attached to account.cs. Now let's try it with no parameters:
C:\Projects\WindowsFormsClient>LabelHistory
CI_20060706.1 (7/6/2006 3:34 PM)
CI_20060706.2 (7/6/2006 3:39 PM)
Label on just Account.cs (7/7/2006 10:49 AM)
Comment: test
Label on just program.cs (7/7/2006 10:49 AM)
Comment: test
New Label (7/5/2006 1:35 AM)
Comment: testing
This is a label on the folder WindowsFormsClient (7/7/2006 10:52 AM)
Notice that we picked up all the labels for the project folder and any files under the folder, including two labels I put on the single files account.cs and program.cs.
It's quite handy. I've packaged up Buck's solution for easier consumption: