0

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

bahrep
  • 29,961
  • 12
  • 103
  • 150
GeoSQL
  • 5
  • 1
  • 4
  • 2
    Why don't you pointing the Web-Server configuration in that way to use your working copy as the htdocs folder ? – khmarbaise May 05 '10 at 20:39

1 Answers1

1

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.

John Weldon
  • 39,849
  • 11
  • 94
  • 127
  • +1, but you should remove the spaces around the '=' sign, or they become part of the variable name. Also, wrap their usage with quotes in case the path contains spaces, e.g. `"%source_path%"` – orip May 05 '10 at 20:49