Tag Archives: shelveset

Private Builds in TFS

My team has configured TFS to automatically kick-off continuous integration (CI) builds when developers check-in changes. The build depends on the affected area, and the time to complete depends on the build. Some of our builds contains hundreds of projects and thousands of unit tests, and these can take the better part of an hour to complete. We also have nightly builds that build even more and take even longer.

Occasionally, I’ll have some changes to check-in at the end of the day. I check them in, and I get a notification that I broke the build when I’m halfway home. Crap. I need to fix the change before the nightly build starts, or it’s going to break, too.

Wouldn’t it be great if there was a way to run a build with my pending changes and then check them in automatically if the build succeeds? Well… There is! TFS has support for private builds (or “buddy builds”) that you can queue with a shelveset.

When I choose to queue a build, I choose to build with local sources plus a shelveset. Then I specify which shelveset, and I have the option to check-in my changes if the build succeeds. Splendid!

Advertisements

Move Shelvesets Between Branches in TFS

At my company, we do a lot of concurrent development between a number of branches. It’s not uncommon for a change made in one branch to be needed in another branch. TFS Power Tools includes functionality to help you quickly and easily migrate a shelveset from one branch into another.

The usage is simple, too. Go to the command-line and type the following (make sure you run it from a directory mapped to a workspace):

tfpt unshelve "My Shelveset" /migrate /source:$/SourceBranch /target:$/TargetBranch

When you run the command, it will load the changes stored in the shelveset into the specified target branch. Super!