Welcome to MSDN Blogs Sign in | Join | Help

Locks based on file types (extensions) and shelving

Recently, someone asked about locks, shelving, and buddy builds (i.e., shelving your changes and unshelving and building them in another workspace to make sure everything builds cleanly).

I am trying to add a number of files into our source control.  The list of files I want to add contains a few each of .ico and .bmp, and one .xls files, all which get locked (locked to prevent check-out) when I add them, presumably because they cannot be merged if someone else checks them out and changes them.

The fact that they get locked seems to deny the possibility of buddy building, even on my own second machine, because they are locked on a by-workspace rather than by-user basis.

I tried selecting the binary items in the hierarchy under the Source Control Explorer, and right-clicking to the “unlock” command, but it always says that the file could not be found in my workspace.

What am I missing?  A preference setting or checkbox somewhere that does not lock added binary files?  Is there some way to turn off or override my own lock?  Is it really not possible to unshelve shelvesets containing binary files to a second machine?

Locking and shelving, while keeping the changes in your workspace, don't mix.  The files that are configured to be locked via file type extension (in VS, Team -> Team Foundation Server Settings -> Source Control File Types) are locked exclusively.

An exclusive checkout lock prevents any other changes from being pended on the file involved.  The file type locking mechanism prevents user from unlocking files that are locked via that mechanism.  So, to do a buddy build, you would need to shelve and undo, which is best accomplished by either unchecking the “Preserve local changes” checkbox in the GUI shelve dialog or using the /move option on the shelve command.  Alternatively, you can change the file types to allow multiple checkout.

The problem is even worse for users where exclusive checkout is turned on for an entire team project, as even plain text files are locked exclusively in that case.  As with the file type extension locking mechanism, users cannot unlock files that are locked due to the team project setting.  When you shelve, you need to move the changes to the shelveset (don't keep them in your workspace).

For us, the file type locking causes problems both with buddy builds and with a check-in system we use called gauntlet.  With gauntlet, we shelve our changes and submit them to gauntlet for it to build them and check them in.  It can't unshelve any item that requires an exclusive lock if you still have the pending change in your own workspace.  As a result, we've turned off exclusive checkout based on file extensions by changing each to allow multiple checkout.

Published Tuesday, January 10, 2006 9:47 AM by buckh

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

# Developing MSBee - Part 8

I hit another TFS snafu on Tuesday which I thought I'd share. MSBee has a unit tests project which currently...
Thursday, June 01, 2006 4:10 PM by Geek Runs Through My Veins

# re: Locks based on file types (extensions) and shelving

I just ran into the same thing. Although locking a file could be a good thing in some situations, its usually bad. Plus, why can't I unlock my own 'locks'.  I have to get on that certain workspace and unlock it.  That seems simple enough, until you find out that the workspace is limited to the computer it was created on, so if you have a workspace on a home machine and your at work, well, your outta luck!

For as much as TFS costs, I think its pretty terrible.  I would much rather use SVN and an issue tracking system like Trac then this piece of garbage that cost mucho dinero.

Friday, July 25, 2008 9:52 AM by Tommy

# re: Locks based on file types (extensions) and shelving

You can unlock files you've locked on a remote machine using the lock command, unless the lock is due to being in the file extension list.

I'm curious to know what has brought you to the conclusion that TFS is terrible.

Buck

Wednesday, July 30, 2008 10:05 PM by buckh

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker