Are you working on an application development which follows code branching strategy in order to deliver timely product releases? If yes, then you might need to merge a shelveset from one branch to another. Here are the simple steps to do the same.
1. Visual Studio 2010
2. Team Foundation Server power tools 2011. Link To Download
Steps to follow:
TFS Power Tools provides the ability to migrate a shelveset, but with the limitation that you can use this feature only through command line.
1. Quick link to open Visual Studio command prompt is press Windows key and type "Command" in search box.
2. "tfpt unshelve" is the command provided by power tools for code migration and that's all you need to know. To get a brief overview about the command type "tfpt unshelve /?" in command prompt.
Quite simple, you just have to use the command as mentioned in usage. However, you need to take care of the source and target branch path.
3. Simple Rule:
I'm assuming that both source and target branch are under the same folder say "Gulliver" here and branch hierarchy is "Gulliver/Code-branch-1", "Gulliver/Code-branch-2". You have created a shelveset in code-branch-1 and want to migrate it to code-branch-2. Also, your solution lies in Code-branch-1, Code-branch-2 folder.
Change your command prompt directory from default one to the both branch common folder, Gulliver here. Thereafter your command to migrate will be:
tfpt unshelve "<shelveset name>";<developername> /migrate /source:"<source branch solution path>" /target:"<target branch solution path>"
e.g. : tfpt unshelve "demo_shelveset";rkandhal /migrate /source:"$/Code-branch-1" /target:"$Code-branch-2/"
Note: Few imp points worth noting,
1. In above command $ in source/target path represents the root directory of your TFS repository. So take care of both paths considering their hierarchy in tfs.
2. You may receive an error entitled: "Unhandled exception has occured in a component in your application. The path 'adbcadsfasdf' contains the character ';'. Remove the ';' and try again." This issue happens because of wrong target branch path. Provide the target branch path somewhat similar to "$/branch-2/" - no colon in the end.
Thats it, you are done. On command execution, if your code is password protected, then you will be prompted for TFS password then Unshelve dialog will open and you're required to select the shelveset which you want to merge. There after auto-merge dialog prompts up and in case you have not provide the correct target branch path, resolution will results to an error otherwise your code changes will be merged to target branch. Here is the snapshot of command output:
Notice that for each file there is a result status in command window.