Visual SVN Server: Guide on Pre/Post Commit Hooks

╄→гoц情女王★ 提交于 2019-12-05 20:45:50

Access to hooks:

1.Start VisualSVN Server Manager

2.Open Properties for your repository

3.Select Hooks tab

4.Edit the needed hook

Hooks are convention rather than configuration based. You don't have to "hook" them up. Create a pre-commit hook and you have a hook running before commits. Create a post-commit hook and you have a hook that runs after a commit.

Here are the steps you can do in your post-commit script for what you need:

You get the repo path and revision commited as arguments to the post-commit hook, so use something like repo=%1 and rev=%2 to get these values.

One way to copy files after commit would be to have a working copy on your server, issue an svn update on this working copy after your commit in your post-commit hook and then copy over the files. You can selectively copy over files by getting the files that changed using svnlook changed. svnlook needs a revision and use the rev variable that you set earlier.

The script itself can be in any language.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!