[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Bug in pre-revprop-change hook calling (1.1.0rc1)

From: Sven Mueller <sm_at_leogic.com>
Date: 2004-08-05 21:52:39 CEST

Hi.

I just wanted to tweak our pre-revprop-change hook to not only limit by
the property (only svn:log may be changed), but also by the user who
tries the change (only the original author is allowed to change the log
entry). The server is running 1.1.0rc1, the relevant parts of the hook
script are:

============================== cut ===================================
REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"

OLDUSER=`/usr/local/subversion/bin/svnlook author -r $REV "$REPOS"`

if [ "$PROPNAME" = "svn:log" -a "$USER" = "$OLDUSER" ]; then
         exit 0
else
         touch /tmp/pre_rev_prop_failed.log
         (
                 echo '$REPOS:' $REPOS
                 echo '$REV:' $REV
                 echo '$USER:' $USER
                 echo '$PROPNAME:' $PROPNAME
                 echo '$OLDUSER:' $OLDUSER
         ) >> /tmp/pre_rev_prop_failed.log
         exit 1
fi
============================== cut ===================================

When the call fails, this is what is written to /tmp/pre_rev_prop_failed:

============================== cut ===================================
$REPOS: /var/repositories/admin
$REV: 510
$USER:
$PROPNAME: svn:log
$OLDUSER: sm
============================== cut ===================================

As you can see, the user parameter ($3) is actually passed to the script
(if not, the svn:log would move up into the USER parameter), but empty.

Hope it helps.

cu,
sven

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 5 21:53:26 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.