简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM