'Post-commit-hook in Subversion doesn't work as I want

i came across a problem with subversion at my work. I want to create a post-commit-hook (post-commit.bat file) command that creates information about the last transaction. The code looks like this:

@echo off

set file="D:\mypath\logfile%2.txt"

svn log D:\'my path to repro'\ -r %2 -v > %file%

The %2 corresponds to the last revision number. It creates the file with the correct number and tries to write in it. But then the commit hangs and the file remains open. The curious thing is, if I manually trigger the command with a valid revision number, then the whole thing works. Only with the hook it hangs and it also does not commit the files. Can anyone help me or have any ideas for my problem?



Solution 1:[1]

I found a solution, maybe this might be helpful for some person.

I used the wrong command "log". Instead you have to use "svnlook changed..." on the server to get the latest information about the last commit.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sören