Centos – SVN Commit Not Updating Files On Server

centossvnversion controlweb-server

I have followed this guide http://wiki.centos.org/HowTos/Subversion and everything has worked as far as 5.3 (i can check out files).

I had an existing directory "/var/www/file-manager". This directory is mapped to a virtual host (ie this is a live website that i can access through a URL). I added this directory to SVN (using servers command line).

svn import /var/www/file-manager file:///var/www/svn/repos/mytestproj -m "Initial repository layout for mytestproj"

I successfully checked out the whole directory using tortoise SVN (I used "http://svn.example.com/repos" to get the files). I modified one of the php files and committed it back using the commit option. This updated the revision number and appeared to have worked. I went to /var/www/file-manager and opened the file i just modified, but the change was not there. According to tortoise the file is up to date with the server, yet the file on the server is not. Any idea whats happening here?

I eventually want to use this for the full website (which is considerably larger), so i want to figure out what is wrong before i do this. This directory existed before i installed SVN

Best Answer

An svn import does not turn the folder you imported into a working copy. You'll need to do another checkout on /var/www/file-manager and then do an svn update on it for it to see the changes from your other commits.

Subversion does not automatically update other working copies. You need to do a manual update on those working copies to see the changes you've made.

This is very much by design. You don't want your production system getting updated every time you accidentally commit some code with a critical bug.

Additionally, if you're going to be hosting your website from an SVN working copy, you'll want to add .htaccess rules barring visitors from poking around in the .svn folders. Or, even better, don't run your website from a working copy. Have an update script that has a working copy somewhere else, do an svn update on that, and then an svn export from the working copy to your live website.