Gated Check In Build Fails – File Locked

Update:

The process for initiating a gated check in containing a locking check out has been improved for RTM!

The default is now to display the options expander, with the ‘Preserve my Pending Changes’ check box unchecked and greyed. A tooltip is supplied on hover for the check box which states “The pending changes being checked in contain one or more locks. The build service cannot unshelve or check in your changes if your local changes are preserved.”.

The following therefore only applies to Beta 2 of TFS 2010.

—-

Working with gated check-ins can save you time by verifying your changes before committing them to the repository. This is great in terms of keeping your code base healthy and enabling team development. Recently I’ve seen teams start to use this feature and struggle with a consistently breaking gated check-in build. What I noticed was common across these builds was the cause – a locked file.

Check In Build - Locked File Failure

Gated Check In Build - Locked File Failure

This occurs when your check-in involves a binary file, which TFS automatically forces into a locking check out. This means that when your gated build goes to ‘get’ the file into it’s build workspace it clashes with the lock you have locally.

The fix here is to un-check the “Preserve my pending changes locally” option on the gated build initiation screen. This will undo your local changes and allow the build to get the binary into it’s workspace. The thing to remember here is if the build breaks, you’ll need to know the name of the shelve set to get it back down locally and fix the issue. Luckily it’s right there on the build initiation screen for you, and you can either screen shot or copy it out for later.

Gated Check In Build

Your other option is to use the dialog that pops up with the build results to un shelve the changes…

Gated Check In Results Dialog

Results Dialog

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s