Welcome to MSDN Blogs Sign in | Join | Help

How to: Disable multiple check-out on a folder?

There’s no direct way to do that. Multiple check-out is a property of a team project, it's not namespace specific. However, I can think of 2 alternatives using use the "Lock" feature, because that’s what TFS does when a team projects is set to exclusive check-out mode, it attaches a check-out lock for each pending change. Back to our alternatives:

1- You can ask users to check-out items with a check-out lock (they can do that using the Check-out dialog or the command-line). Or, if they already have checked-out items, they can still use the lock command to set a check-out lock on it. This will disallow other users to checkout the items.

2- You can write a program, for example something that can run in the background like a windows service, that subscribes to the VersionControlServer.NewPendingChange event and sets a check-out lock on the new pending changes. Please note that calling "lock" itself is pending a change, hence, the event handler is going to be invoked again, so you have to make sure that the code handles this case correctly, by ignoring it.


Either way, please do NOT use the /r option with the lock command, it's recursive by default if you set it on a folder.

Published Wednesday, March 25, 2009 12:24 AM by mohamedg
Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Anith » How to: Disable multiple check-out on a folder?

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker