TFS



Hi all guys,
it’s time to learn something new about Team Foundation Server.

Sometimes happens that you (or in enterprise organization a tester, who really is an essential role when you want to work efficiently focusing on customer) discover a bug into sources that you had deployed to some customer or to tester for making tests. So, in this scenario until yesterday, I believed that you are forced to make a branch from the label that you delivered than apply your patch into the code and merging it into main (or development) branch. That’s quite complex and you can do something better!

In fact you can get the sources at Labeled version, then directly apply your fix and checking it! What happens? Really simply and efficiently: your patch will be contained in the Label and the patch is merged into the latest version too! Really impressive!

If you need some practical information you can take a look at this article I found: http://www.olegsych.com/2009/04/simplifying-tfs-applying-hot-fixes-without-branching/


Hi all guys,
today I discovered that when you delete a branch from the Team Explorer in Visual Studio, the branch is not really deleted, but you can ‘restore’ the deleted branch if needed.
Bye the way if you really want to delete a branch (maybe after some months after the ‘weak’ deletion) you can do it using Visual Studio Command Prompt Console.
First of all you can see all the deleted branches in your Team Explorer enabling the following flag in your Tools > Options > Source Control > Visual Studio Team Foundation Server:

image

If you really want to delete a branch you can execute the following command (from Visual Studio Command Prompt):

tf destroy $/MyProject/Main/Bin /collection:http://servername:8080/tfs/myproject
Do you want to destroy $/MyProject/Main/Bin and all of its children? (Yes/No) y
Destroyed: $/MyProject/Main/Bin;X3601
Destroyed: $/MyProject/Main/Bin/Native;X360

You can find additional documentation from Micsofot here and remark that you can use the /preview option for seeing which files will be permanently deleted. I suggest you to use output redirection in order to really check all files in the following way:

tf destroy $/MyProject/Main/Bin /collection:http://servername:8080/tfs/myproject /preview > c:\prova.txt

Additionally you can force tfs to clean all files of this branch from the DB after executing the command specifying the following option /startcleanup. By default, the clean-up is scheduled to run once each day.