Server side hook scripts

A hook script is a program triggered by some repository event, such as the creation of a new revision or the modification of an unversioned property. Each hook is handed enough information to tell what that event is, what target(s) it's operating on, and the username of the person who triggered the event. Depending on the hook's output or return status, the hook program may continue the action, stop it, or suspend it in some way. Please refer to the chapter on Hook Scripts in the Subversion Book for full details about the hooks which are implemented.

These hook scripts are executed by the server that hosts the repository. TortoiseSVN also allows you to configure client side hook scripts that are executed locally upon certain events. See “Client Side Hook Scripts” for more information.

Contoh naskah hook bisa ditemukan dalam direktori hooks dari repositori. Contoh naskah ini cocok untuk server Unix/Linux tapi perlu diubah jika server Anda berbasis Windows. Hook bisa berupa file batch atau eksekutabel. Contoh dibawah memperlihatkan file batch yang bisa digunakan untuk mengimplementasikan hook pre-revprop-change.

rem Hanya mengijinkan log pesan untuk diubah.
if "%4" == "svn:log" exit 0
echo Properti '%4' tidak bisa diubah >&2
exit 1

Catatan bahwa setiap pengiriman ke stdout diabaikan. Jika Anda menginginkan pesan muncul dalam dialog Tolak Komit Anda harus mengirimkannya ke stderr. Dalam file batch ini dilakukan menggunakan >&2