If you want to link to an html file directly in a subversion repository, there is a problem. By default, subversion doesn’t distinguish between filetypes other than binary versus text. So when you request a (text) file directly from the repository, it comes in as text/plain, no matter what it really is. This causes all standards-following browsers to render it as text, which isn’t so good if it’s an HTML file. The same problem will also exist if you reference CSS files, as they will be ignored if they don’t have the correct MIME type (at least, this used to be the case with Firefox).
However, fixing this is pretty simple:
svn propset svn:mime-type text/html *.html svn propset svn:mime-type text/css *.css
do a commit, and you can now provide links directly to HTML documents inside your repository.
This change can be made across all new files you put in the repository by adding the following lines towards the end of ~/.subversion/config:
*.html = svn:mime-type=text/html *.css = svn:mime-type=text/css
This stuff is documented more in the subversion book. One word of warning, the MIME type for JavaScript files is application/x-javascript. If you set your .js files to this, then Subversion may start treating them as binary. I haven’t tested this, but it doesn’t matter, as Firefox doesn’t seem to care what the MIME type of JavaScript files is.
Thanks mate! This had me confused for quite a while.
perfect helped me out a lot