Question

I am working on a web based project in my free time. I have SVN set up on my machine (running XP). What I would like to do is have a copy of my repository copied to the htdocs folder (Dev machine) post-commit via a hook. That way I can test my changes in a browser.

I know that I can write up a .bat file, but I'm not sure what the syntax would be. I can do a basic DOS Copy command, but I saw one example that provided a username and password to SVN at copy time. Do I need to do this?

Can someone point me in the right direction as far a syntax for the .bat file?

Or maybe even suggest a better method.

Thanks

Was it helpful?

Solution

The red-bean book has a section on hooks. The post-commit parameters are described also.

@echo off
set destination=c:\inetpub\wwwroot\blah\blah
set source_path=%1
set revision=%2
svn export --username user --password pass "%source_path%" "%destination%"

That all being said; I wouldn't couple your testing environment so tightly with your source control if you didn't have to.

You could write a completely standalone job that polls the subversion location you're interested in and does the export when it detects a change.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top