开发者

Subversion Copy Hook on Windows

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜