I am using the 2012 edition of the TFS Client Object Model to retrieve some file information within repositories. Given a string specifying the path to a file in a TFS project, I'd like to find out who has checked out a file if it is locked. I use VersionControlServer.GetItems(...).Items
and a Where
predicate to get only the files (not folders) I am interested in.
Asked
Active
Viewed 527 times
0
-
I find that it's easier to just have a look in Visual Studio and TFS to see who has a file checked out or locked. Have you tried looking at: http://msdn.microsoft.com/en-us/library/bb138911.aspx (all the other GetItems(...) found here: http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.versioncontrol.client.versioncontrolserver.getitems.aspx) – xcodr Feb 12 '14 at 05:17
-
I need to do it programmatically. Its for a project, not just for my own code management. :) – gdoug Feb 12 '14 at 06:26
1 Answers
1
QueryPendingSets
is your friend!
Sample:
PendingSet[] queryPendingSets = versionControlServer.QueryPendingSets(new [] {"$/A/B/C.txt"},RecursionType.None, null, null );
This lists all pending changes for the specified file. You can get them all by looking at:
queryPendingSets[0].PendingChanges

Scordo
- 1,041
- 7
- 12
-
Thats it! `queryPendingSets[0].OwnerName` is precisely what I wanted. :) – gdoug Feb 14 '14 at 04:02