Objective
Locate the Repository (repositories) folder in the SVN server and locate the Hooks folder in the appropriate project folder. Add a Post-commit file to the folder, and when a commit action occurs (when committed to SVN server) The Post-commit file is executed, where the data is copied,
Steps
1. Locate the SVN server side of a project warehouse directory (in this case, a new test project has been created on the service side):
2. Create a new Post-commit.bat file in the hooks directory with the following contents:
@echo off
SET repos=%1
SET rev=%2
SET Dir=%repos%/hooks
SET path=%path%;
SET Working_copy=e:/myweb//Here is your project path
SVN update%working_copy%--username tianyl--password 111111//Enter SVN user name password
3.web directory must use TORTOISESVN checkout out repositories code
4. There is also a note on the--visual SVN server permissions, otherwise the following error may occur:
Post-commit Hook failed (exit code 1) with output:
svn:E155004:Working copy ' d:/www/test ' Locked
Svn:E200031:sqlite:attempt to write a readonly database
Svn:E200031:sqlite:attempt to write a readonly database
Svn:run ' svn cleanup ' to remove locks (type ' svn help cleanup ' for details)
The reason is that the Visual SVN Server service does not have enough execution permissions to read and write to the specified directory. Workaround, modify visual SVN Server
Simple operation Windown under Run input services.msc find Visual SVN Server service right-click Properties login Panel set desktop interaction or administrator permissions try again
Windows SVN hooks implement each commit update to the Web directory