views:

58

answers:

3

I'm just getting started with svn so please, help me out if I saw anything stupid.

I'm developing on a windows laptop using tortoisesvn. I'm deploying to a linux server.

I have my repo set up and checked out on my laptop. I can't manage to check it out to a directory on the server. I've created a directory for it but can't get svn checkout file:///... to work! Based on this tutorial the checkout command takes the following form: svn checkout file:///repository_name/project/trunk project but what is the repository_name? My repo is at /home/username/svn, I don't remember naming the repo other than saying what directory it's in.

Once I do actually have that sorted I would like to have the repo automatically export to that directory when I commit from my laptop. Is that possible?

Sorry if that's horribly unclear but I wanted to be detailed.

Basically I want to commit from my laptop and have that trigger an export of the newly commited files to a directory on the server.

+2  A: 

Maybe this discussion on Ubuntuforums helps (provided your repo and web server are running on Linux). It explains the concept of Post Commit Hooks, and shows actual example scripts.

Pekka
A: 

If you're trying to get a copy of your svn coment to a directory where you can view it (as opposed to actually working on it), you should use the svn export command.

Ether
A: 

There are two different ways you can automatically export to your public_html folder, both of which involve setting up a post-commit hook. You could:

  1. Setup a post-commit hook that will run on your Windows laptop and copy the necessary files to your server, perhaps through scp (available in the Putty suite), rsync, or even a samba file share.
  2. Setup your Linux-server to host your repository so that it has full access to the filesystem on which your public_html folder exists, and then setup a post-commit hook that copies the necessary files to your public_html folder. Of course, you would need to checkout from the Linux repository instead of the one on your laptop, but it might be worth it.

Now, a couple of things you've stated above are a bit... confusing. I've made some assumptions that reconcile the above, so please comment if I have mis-assumed.

Right now, you have both the repository and a checkout on your laptop. And, it sounds like you have used the file:// protocol for your checkout. If so, you will not be able to access your repository from your Linux server (yes, it is possible if you're also serving your repository over SSH or http). This would explain why you can't get a checkout using the same file protocol within Linux -- it doesn't have access to your Windows file system.

Given the above, I would try approach number one above. Write a script (or program) that copies the files to your Linux server.

Kaleb Pederson