R – How to get Subversion to work with auto-generated files

svntortoisesvnvisualsvnweb-deployment-project

I'm using ASP.NET Web Deployment Projects with TortoiseSVN and VisualSVN, but this is a general question about generated files in Subversion.

A Web Deployment Project automatically generates a parallel "deployment" version of your website with all code stripped out and compiled into a single assembly. My file structure is:

  • Trunk
  • Trunk/MyProject (website root)
  • Trunk/MyProject_deploy (deployment project root)
  • Trunk/MyProject_deploy/Release (deployment website root, automatically generated)

Here's the problem: MyProject_deploy/Release is regenerated on build (in Release mode). The directory is deleted and re-created, so I lose all the .svn metadata; and when I go to commit, I get status "Obstructed", which I've looked up and means that there's an unmanaged local folder with the same name as a managed folder on the server.

(I could just ignore the Release folder, but I want to do FTP deploy directly from the Subversion server.)

What's the best way to deal with auto-generated files in Subversion?

Best Answer

Set the svn:ignore property. Don't add them to your version control system. Anything generated by the build process doesn't belong there. What does belong there are the things needed to complete the build process.

I'd recommend adding a continuous integragion server like CruiseControl.NET to the mix - it can build the project from the source, and then do the deploy from that. This will put you in the position of using 2 best practices instead of 1, and still solve your problem.