SubVersionのhooksスクリプト
元々がunixなツールなので、/bin/shなスクリプトの例はいっぱいありますが、Windowsではどうスクリプトを書けばいい?と悩んでいました。特に拡張子について。
ここでバッチファイルな例を見つけたのでメモメモ。m(_ _)φ もっと詳細な例はこちら。
@echo off rem [1] REPOS-PATH (the path to this repository) rem [2] REVISION (the revision being tweaked) rem [3] USER (the username of the person tweaking the property) rem [4] PROPNAME (the property being set on the revision) rem [STDIN] PROPVAL ** the property value is passed via STDIN. if "%4"=="svn:log" ( if "%3"=="babydaemons" ( exit 0 ) ) exit 1
ユーザがbabydaemonsさんの場合のみログの編集を許可する例です。
All in one tracだと、C:\trac-0.1.1\svn_repo\projects\MYPROJECT\hooksにpre-revprop-change.batで置いてあげればOKなようです。
CUIでsvnコマンドを使ってクライアントからログを編集する例はここにありますが、TortoiseSVNを使っているのでGUIからさくさくと手抜きしてますw