views:

310

answers:

2

First, I would like to clarify a quick question I have, am I right in thinking that files in svn repo don't actually exist in the heirarchical structure you see when you check them out?

I have tried to use svn export ~/svn/project1 ~/public_html/project1 but it didn't work.

What I actually want is to have the export command automatically executed when I do a commit so that I can see my changes immediately in a web browser.

+1  A: 

am I right in thinking that files in svn repo don't actually exist in the heirarchical structure you see when you check them out

Correct... they actually exist in a DB of sorts in the repository directory. However you can invoke svn export on a working copy or a respoitory url. So lets say your repo is on the system at /svn/myproject and you have a working copy of trunk at ~/myproject then either of the folloring commabds will export properly:

svn export --force ~/myproject ~/public_html

svn export --force file:///svn/myproject/trunk ~/public_html

ofcourse you can subsitute the svn, http, or svn+ssh for the file protocol depending on how your access is set up.

prodigitalson
What specific problems does the `--force` deal wit? I had an issue with export already:`svn export ~/public_html/svnmfrsvn: '/home/firefli/public_html/svnmfr' is not a working copy`
Matt
if `public_html` already exists the force flag will make the export overwrite it... otherwise it will complain that the directory already exists. The error you got means that whatever you tried to export wasnt in fact a subversion working copy - export is only invokable on working copies or a repository.
prodigitalson
How can I make a working copy on the server?
Matt
do a checkout. if its a public server though youll want to make the `.svn` directories unaccessible with a `.htaccess`
prodigitalson
So I will have the actual versioned code in some folder, a checked out copy somewhere else on the server, _and_ a copy that's exported to public_html?
Matt
No, you don't make a checkout on the server. You can export directly from the repository, which is what you want to do...not export from a working copy.
Michael Hackner
A: 

Yes; see Where are my svn files?

Automatically exporting can be done with a post-commit hook.

Michael Hackner
Where do I put the post commit hook? I have a repo on a linux server and I'm committing to it from my windows box. I need the hook to export from the repo to another directory on the linux server.
Matt
@Matt:Youll need access to svnadmin for that i think - are you an admin level user on this server or is svn running out of your user home?
prodigitalson
svn is running from /home/user yeah
Matt