1

How do I invoke svn propset in an svn hook?

My svn repo allows change wrong svn:log properties. It is implemented with default pre-revprop-change template.

I want to modify default pre-revprop-change template and saving old history in other revision properties.

So I wrote script, that invokes svn propset in svn hook:

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

if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ];
then
echo "log01" >> /var/svn/history01.txt; #temp for testing
svn propset --revprop -r $REV  log:my "old_msg_for_history"
file:///var/svn/repo

exit 0; fi

if [[ $PROPNAME == log* ]];
then
        if [ "$ACTION" = "M"];
        then
        echo "log23 $REV" > /var/svn/history.txt; #temp for testing
        fi;
 exit 0; fi

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

When I invoke directly

svn propset --revprop -r 38041  log:my "msg_for_history" file:///var/svn/repo

it works fine

When I invoke undirectle via hook

svn propset --revprop -r 38041  svn:log "msg_for_history" file:///var/svn/repo

svn propset is not invoked, but diagnostic message appears

echo "log01" >> /var/svn/history01.txt; #temp for testing

Why?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
qwazer
  • 7,174
  • 7
  • 44
  • 69

0 Answers0