tags:

views:

249

answers:

2

How do I update my subversion repository so it can accept updates to the log message field? I've got a Windows installation and I changed the pre-revprop-change.tmpl file name to a batch file, but now when I try to update a the log message property my tortoise svn just hangs and the property isn't updated. Am I doing something wrong?

Since its so small, my pre-revprop-change.bat file is below

REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"

if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi

echo "Changing revision properties other than svn:log is prohibited" >&2
exit 1
+1  A: 

That's not a proper batch file; you need to use cmd.exe batch syntax.

Here is an example that you might want to try (after adjustments perhaps).

Martin v. Löwis
+1  A: 

Here is the file I ended up using, I couldn't debug the part that checks to make sure the log message isn't empty, if someone could I'd appreciate it. Obviously I realize that I commented it out.

@ECHO OFF 


set repos=%1 
set rev=%2 
set user=%3 
set propname=%4 
set action=%5 

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 
:: Only allow changes to svn:log. The author, date and other revision 
:: properties cannot be changed 
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 
if not %propname%==svn:log goto ERROR_PROPNAME 

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 
:: Only allow modifications to svn:log (no addition/overwrite or deletion) 
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 
if not %action%==M goto ERROR_ACTION 

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 
:: Make sure that the new svn:log message contains some text. 
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 
::set bIsEmpty=true 
::for tokens=* %%g in (find "") do ( 
:: set bIsEmpty=false 
::) 
::if %bIsEmpty%==true goto ERROR_EMPTY 

exit 0



:ERROR_EMPTY 
echo Empty svn:log properties are not allowed. >&2 
goto ERROR_EXIT 

:ERROR_PROPNAME 
echo Only changes to svn:log revision properties are allowed. You tried %propname% >&2 
goto ERROR_EXIT 

:ERROR_ACTION 
echo Only modifications to svn:log revision properties are allowed. >&2 
goto ERROR_EXIT 

:ERROR_EXIT 
exit 1
Jonathan Beerhalter