私はいくつかのSubversionコミットフックをテストしようとしていますが、最も単純なケース - ローカルリポジトリとfile://プロトコル - を使用すると、フックは実行されません。SubversionフックはファイルURLで動作しますか?
は、私は、Windows上だ - ここでは簡略化した例のトランスクリプトです:
C:\>mkdir \testsvn
C:\>mkdir \testsvn\repos
C:\>cd \testsvn\repos
C:\testsvn\repos>svnadmin create --fs-type fsfs /testsvn/repos
C:\testsvn\repos>cd \testsvn
C:\testsvn>mkdir source
C:\testsvn>cd source
C:\testsvn\source>echo This is a readme file.>readme.txt
C:\testsvn\source>svn import file:///testsvn/repos/somemodule -m "Imported somemodule"
Adding readme.txt
Committed revision 1.
C:\testsvn\source>cd \testsvn\repos\hooks
C:\testsvn\repos\hooks>copy con pre-commit.bat
echo Commits disabled! 1>&2
exit /b 1
^Z
1 file(s) copied.
C:\testsvn\repos\hooks>md \testsvn\checkout
C:\testsvn\repos\hooks>cd \testsvn\checkout
C:\testsvn\checkout>svn checkout file:///testsvn/repos/somemodule
A somemodule\readme.txt
Checked out revision 1.
C:\testsvn\checkout>cd somemodule
C:\testsvn\checkout\somemodule>echo This is line 2 of the readme file.>>readme.txt
C:\testsvn\checkout\somemodule>svn status -u
M 1 readme.txt
Status against revision: 1
C:\testsvn\checkout\somemodule>svn commit -m "This should fail if the pre-commit hook works..."
Sending readme.txt
Transmitting file data .
Committed revision 2.
最後のコマンドがあるため、私の極度のが失敗したはずのフックをコミットします。私は間違って何をしていますか?
私はバッチファイルpre-commit.batを実行できますが、これは私が期待することです(この単純化されたケースでは、エラーメッセージを書き込み、エラーコードを返します)。 – Jonathan