1

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

Dan Hastings
  • 706
  • 1
  • 13
  • 24

1 Answers1

1

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.

Mark Henderson
  • 68,823
  • 31
  • 180
  • 259
  • ok this makes sense. This has worked for a test directory. Only issue is the main website is large. Theres over 200,000 (25GB) images in the /images directory. If i add this to SVN im going to run out of HDD space. Is it possible to ignore /images and just commit the code to SVN. Then i delete all code and checkout which should repopulate everything. Then i can make a post hook that runs an update on /var/www/html after i commit? – Dan Hastings Jan 30 '15 at 23:21
  • There's a few issues to address here. One is the lack of free space on your server - that sounds like by far the most critical thing to address. But ultimately that all sounds too complex. Just check it out onto a different server (dev one or something), then SCP it to overwrite your existing site. This will then "convert" your website into a working copy that you can `svn update`. – Mark Henderson Feb 01 '15 at 20:26