How to update properties in subversion
How do I update my subversion repository so that it can accept updates to the log message field? I have a windows installation and I changed the filename pre-revprop-change.tmpl in the batch file, but now when I try to update the log message property my svn turtle just hangs and the property is not updated. Am I doing something wrong?
Since it is 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
0
source to share
2 answers
Here is the file I ended up using, I was unable to debug the part that checks to make sure the log message is not empty, if I could appreciate that. Obviously I understand that I have commented on this.
@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
+1
source to share