I have a zip file that I am checking-in to TFS. The zip file is a save file for a workflow and contains a few xml files. I want the be able to see the differences in the xml files when looking at the history of this file. Right now I am manually extracting the zip and checking-in the extracted files themselves.
Is there a way for me to have TFS detect I am checking-in a zip file and automatically extract and check-in the contents of the zip file as well as the zip file itself?
Is this something that I could do with a custom check-in policy? Is there a better way to do this?
When you are committing a file to version control it gets committed exactly as it was in your local workspace, aka as a .ZIP file. There’s no out-of-the-box hook in TFS that will extract a zip file, and then check-in the extracted files to version control.
There are a couple possibilities here…
You could setup a team build which used the folder which contains your .zip as a workspace and configure it to “build on check-in.” Then, in the logic for your build you grab the .zip file, extract it, and check the files into source control. There is an Unzip task in the MSBuild community extensions ( http://msbuildtasks.tigris.org/ ). You can use the MSBuild Exec task to shell out to tf.exe for performing the check-out \ check-in.
You could also extend TFS services and write a custom check-in action as described here:
http://vinubaby.wordpress.com/2009/04/16/perform-a-custom-action-for-check-in-event-in-microsoft-team-foundation-server/