Friday, October 19, 2007

Working with TFS offline / disconnected

If you have worked with TFS (stands for Team Foundation Server, not for Tradition Financial Services or Toronto French School) when the server is unavailable (if your server is down or your VPN connection has gone away) you have definitely experienced one thing:

Working with disconnected TFS sucks!

Yep. This is truth and the truth hurts. I have even recently heard developer saying "Fucking TFS. SourceSafe was better. It just worked". I did not want to comment on TFS vs SourceSafe - both hands up for TFS and its atomic change sets. I also did not want to comment on TFS vs Subversion, where Subversion just stand out in disconnected environment. MS are promising that this "mistake" will be fixed in the next version of TFS. But while we are waiting for it I will tell you (you maybe already aware of it already) how to make it less painful.

Team Foundation Power Toys (Tools) - TFS painkiller

Don't hesitate and go straight to the download link. TFPT consist of a bunch of useful tools and additions to TFS. Most interesting is the command line utility - TFPT.exe, which have a bunch of options. What we need is the option online of the tool. Here is sample how to use it:

tfpt.exe online /recursive /delete path_to_folder_with_solution

We need the recursive switch to recursively walk through the directories and search for changes. Delete is required if you have deleted items from the solution. This command will bring a popup windows that will display all actions that you will do. If you did not the window to show you can use the /noprompt switch. If you are uncertain what will happen you can use the preview switch:

tfpt.exe online /preview /noprompt path_to_folder_with_solution

This will show all the modifications that will be done, without actually doing them. Note that if you have renamed files the tool did not catch it. So it may sounds silly but don't rename while disconnected.

You can read more about the tool here and here or in the document that comes with the installation.

Hope this will help you leave the swearing from TFS to some other place. I can think about two or three of those places. What about you?

No comments: