Branching and Merging Improvements in TFS2010

Posted by jehan on Geeks with Blogs See other posts from Geeks with Blogs or by jehan
Published on Sat, 19 Mar 2011 11:37:19 GMT Indexed on 2011/03/19 16:10 UTC
Read the original article Hit count: 339

Filed under:

Introducing the concept of “first class branches” is a significant improvement as part of the 2010 release with respect to version control.  Not only does it help to distinguish between folders and branches, but it enables branch visualizations. Let us see improvements in detail.

·         In TFS2008, you don’t know which of the folders are Branches: All folders looks the same, all have the folder icon.

Now, In TFS 2010 there is a new icon that shows which of the folder is a Branch.

      ·      There is no visual means to manage branches in TFS2008:   You dont have any means to identify which branches are related and the relation type. Now, In TFS 2010 you have visual tools to see the Branches Hierarchy.

In order to see a Branch Hierarchy just Right Click the Branch and choose: Branching and Merging –> View Hierarchy

  

 ·         In TFS2008, there is no option to track changes path between the Branches:  If you have made a merge in a Branch you can’t track from which Branch this Merge came from. Now, you have the tools that shows the path of change between the Branches, you can also see where change was added on a timeline. 
In order to track a change do the following:
Step1: Right click the Branch and click View History
 

Step 2: Choose a changeset to track and click the “Track Changeset” button.

 
 

Step 3: Choose the branches that will be in the view and click “Visualize”.

In above visual, you can see that Changesets 108,109,110 and 119 where merged from Main to Release1.0 Branch and then “Release_1.0” Branched to “Dev1.0.

Step4: You can also see the Merges on a Timeline by clicking on the “Timeline Tracking” button.

 

Creating New Branches:

In TFS 2010, the creation of branches has been streamlined a bit from the process in 2008.  In 2008, creating a new branch was like every other action in the system – changes were pended on the client, and then checked in to the server. Because of this creating new branch in TFS2008 was time-consuming process.  In TFS2010, the step where changes are pended has been bypassed and now performing the branch creation is entirely on the server.  With this approach, the round trip time for downloading a copy of each file on the branch and then uploading each file again has been eliminated. 

Note: In TFS2010, the new branch will be created and committed as a single operation on the server. Pending changes will not be created, it doesn’t require a check-in as it will be carried out as a single operation and it’s not possible to cancel.

 
 

Manage Branch Permissions:

The properties view for branches is also different than that of ordinary folders or file, containing some metadata for the branch, relationship information, and permissions for the branch.

In TFS2008, the users who have checkout and Check-in permissions can create a branch. But, In TFS2010 you can control the permissions for Branches using Manage Branch permissions.

 

Reparent option in TFS2010:

In TFS2008, if we have two branches which don’t have parent-child relation and we want perform merge between these two branches then we have to perform baseless merge using tf.exe command line. I have two branches Release_1.0 and Dev1.0_F2 which don’t have any relation between them, that’s why when I click on merge option in Release_1.0, in Target Branch it’s not showing Dev1.0_F2 branch to perform the merges.

 

 

Let us see what can we do for this in TFS2010, first perform a TFS baseless merge to establish a relationship between the parent branch and the child branches.  It will only merge the folder, not its contents.

TFS baseless merges are performed via the command line using VS2010 command prompt and do the following:

 

tf merge /baseless <ParentBranch> <childBranch>

Check in your pending changes.

It will create the link between the branches but the relationships are still not completed. 

Now, select the child branch in Source Control Explorer and from the File menu choose Source Control –> Branching and Merging –> Reparent.

  

 
In the dialog box,  choose the appropriate branch as the new parent.
 

Click Reparent and then go to parent branch and click merge. Now, will see that in Target Branch option Dev1.0_F2 branch is added.

 
 
 
 

Converting Folders to Branches and Branches to Folders:

You can convert any Folder as Branch from Context Menu by performing right click on the folderàBranching and MergingàConvert to Branch.

In similar way, you can convert the Branches to Folder using Convert to Folder option available in File Menu (FileàSource ControlàBranching and MergingàConvert to Branch). This option is not available in context menu.

 
 
 
 
 

 

© Geeks with Blogs or respective owner