How to lock a branch using TFS API in TFS 2010?
Is it pos开发者_如何学运维sible to lock a branch using TFS API in TFS 2010?
Workspace.SetLock
I am assuming you already know how to connect to TFS and get a specific workspace.
With that said, you would use Workspace.PendEdit for this.
Workspace.PendEdit Method (String[], RecursionType, String, LockLevel)
The enum LockLevel is defined here:
LockLevel Enumeration
This acts the same as the UI if you were to right-click inside of TFS on the branch itself and perform the lock.
精彩评论