Showing posts with label TFS. Show all posts
Showing posts with label TFS. Show all posts

Tuesday, May 8, 2012

TFS - Creating a Branch from Local Source

Well that was frustrating.

The Problem:
Work has been performed on the source Trunk that now needs to be in a separate branch, and not checked into the Trunk.

The Solution:
Create a branch selecting 'current workspace' as the source version
*Ba Bow* - nope, this doesn't do what you think it does, your shiny new branch does not have your local workspace changes.

Create a branch and merge the changes across
*Ba Bow* merges only work on checked in code.

Create a branch, shelve your changes, unshelve to the branch
*ding ding* we are on a winner, only it is a PITA to get it working.

Firstly you need the TFS power tools - here: http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f
Next you need to, for some reason, ensure you have no other pending changes in your workspace.  I have no idea why, but even if you have pending changes competely unrelated to the shelve files, you will get warnings and may get errors.  Strange but true.
Next you need to call the "tfpt unshelve" power tool command. But you need to call this from a folder in the workspace you are working with as there is no way to set the workspace/server in the tfpt command.

tfpt unshelve MyShelfsetName /migrate "/source:$/MyPath/My Path with spaces/MyBranch" "/target:$/MyPath/My Path with spaces/MyOtherBranch"
Finally, when you run the command you will need to merge all the shelved files into the new branch, one by one.  You can perform an auto-merge, but this will actually perform a merge on the destination/shelf, when in reality you very likely want to take the shelf version rather than do a merge, which requires you to go through file by file.

The link below is a good source of information on this process.
http://codereferences.blogspot.com.au/2012/02/migrating-shelveset-from-one-branch-to.html

Wednesday, January 25, 2012

Why the TFS Hate

For the last few months twitter has been abuzz with TFS hate, and I always wondered exactly why.

Sure there are some annoyances, but on the whole as a full SDLC tool, TFS is a pretty comprehensive and cohesive tool.

It integrates source control, task management, automated builds and testing into a single system, and handles each component pretty well.

Source Control
+ good branching, merging, labelling support
+ good IDE integration
- not as good as a DCVS (such as git)
- ties source code to source control, a massive pet hate and has caused countless issues in the past

Task Management
+ flexible enough to support release planning, resourcing, task management, bug tracking, etc
+ integrates with build and testing components
+ integrates with the IDE
+ fairly easy to modify
- flexibility poor is relative to something like JIRA

Automated Builds
+ flexible
+ integrates with the IDE
+ simple to set up
+ integrates with Unit Testing (and Test Manager for deployment/UI testing)
- complex to modify

Testing (via test manager)
+ integrates with task management (test failures can generat bugs)
+ integrates with builds (you can define a set of automated UI tests to execute on build success)


As a single system nothing comes close to this level of functionality and flexibility, and despite its warts it does work pretty well.

Saying that, I can name off the top of my head better alternatives for each component, such as Git/Mercurial for source control, TeamCity for builds, HP or Rational Test Managers, JIRA for task management/workflow. Some of these integrate with TFS or Visual Studio to varying levels, but setting them up and day to day integration between these systems is not going to be as cohesive as a single TFS solution.

Granted I know in the past I have struggled to correctly set up TFS, Sharepoint, Reporting Services, Test Center, and HyperV to all work correctly, so perhaps configuring all these external systems is not as difficult as I think.

Git and TeamCity are definitely items I want to become familiar with if only to find out what the hype is all about, but I again reiterate that I don't really understand all the hate with TFS.

Perhaps more experience with these other systems will turn me into a TFS hating ragaholic too :)