views:

101

answers:

1

Hi,

We're a small team and we're running subversion and apache on the same server.

We're currently facing a small problem: everyone saves their edits of our web application directly to the server, which means countless errors when we all work on the same class.

Now we're trying to solve this by letting the server use the files in subversion only, so that everyone can freely edit their files without breaking the application.

Any idea how I can do that?

by the way, we're running Apache on a Windows machine.

+4  A: 

I am not fully sure if I understand the question correctly, so apologies if I misunderstood.

One way of accomplishing this could be to use a post-commit hook that does an export of the tree to the appropriate directory and restarts the server process (if and as needed).

asmodai
Would you elaborate on that a bit please?
KeyStroke
Sure, subversion allows for a variety of so-called hooks, in essence scripts that are run on specific events, such as before a commit is truly committed to the repository, or after the fact. You can use these for, say, emailing diffs of commits to a commit mailinglist as many projects do.In your case, if I understood correctly, you want your people to use local working copies to work on the code, check in the code, and only have the server run the latest files as in the repository.To accomplish this you want to use the "post-commit" hook to take care of the export and restart.
asmodai
See http://svnbook.red-bean.com/en/1.5/svn.reposadmin.create.html#svn.reposadmin.create.hooks and http://svnbook.red-bean.com/en/1.5/svn.ref.reposhooks.post-commit.html for some background on them.You will find the files in the hooks directory in the repository. You can simply create a "post-commit.bat" or "post-commit.exe" (since you're on Windows) which takes care of the svn export of the appropriate part of your tree. You then need something that can restart the webservice, if it needs that.
asmodai