I am trying to prepare a post-commit hook for my svn repository. So I need a log message from the last commit that I get with the command svnlook log -r %REV% %REPOS%. Filling a fragment with appropriate parameters I get the following multline log message:
This
is
my
transaction.
It works well. Now I put this in a .bat file:
@ECHO OFF
REM just for testing purpose...
SET REPOS=C:\repo
SET REV=40
FOR /F %%i in ('svnlook log -r %REV% %REPOS%') do SET VAR=%%i
ECHO %VAR%
When I execute the script, only the last line is output transaction.. For-loop is a snippet from which I thought it would read svnlook's output %var%.
My approach is to get the log message in a variable that I pass to another exe file as a parameter. But that will not work. I do not know how to use the loop correctly.
exe .
script (@ PA.)
@ECHO OFF
setlocal enabledelayedexpansion
SET REPOS=C:\repo
SET REV=40
SET MSG=
FOR /F %%i in ('svnlook log -r %REV% %REPOS%') do SET VAR=!VAR! %%i
ECHO !VAR!
This is my transaction. , .