Posts

Showing posts from May, 2010

More TFS Fun

You try to merge SOURCE_BRANCH with TARGET_BRANCH and get the following error: TF14083: The item '$/xx/yy/zz.cs' has a pending merge from the current merge operation, please resolve and check in the current merge and merge again to pick up this change. Simply merge that specific file separately, check in, and then continue the large merge operation

Rollback on branched changes

Hi kids, Today, we're going to learn how to perform a rollback in a TFS branch where you ONLY want to affect the current branch (i.e. you don't want your rollback to affect branches with whom you branch changes). Scenario We have "contaminated" a (Release) branch with changes that belongs to the next release down the road. An issue arrise in production, which needs immediate hotfixing. The responsisble team makes their change in their dedicated Hotfix branch, but when they are to merge their changes to the Release branch, they realize that the release branch does not look like they left it. (In this scenario, deployment scripts scripts are configured to deploy from the Release branch and nothing else). Technical Solution (You'll need Microsoft Team Foundation Server Power Tools (TFPT)) Sequential rollback of changes in Release Get history of changes in branch CAREFULLY write down the change-set numbers Undo (and shelf) any local changes

StringBuilder vs. String.Concat

Did you know that the String.Concat is really optimized (fast)? I've always seen it as an equivialent of StringBuilder, but as it turns out, String.Concat can be the better choice in many areas. As a recap of earlier blog posts, if you are going to concatenate two strings, you might as well use the add operator ( var result = "Hello " + "World"; ). However, if you want to build a larger string, you might want to consider one of the two constructs discussed in this post. My recommendation is to use String.Concat for average-sized strings, and StringBuilder for larger strings that are built over time: // String.Concat logger.LogError(String.Concat( "Error doing this and that for ", customerId, ", doing action ", action, " with properties ", properties )); // StringBuilder StringBuilder buffer = new StringBuilder(); string line = null; while((line = stream.ReadLine()) != null) { if(buffer.Length