RE: pre-revprop-change hook problem
From: Stawiszynski, Piotr <Piotr.Stawiszynski_at_sabre.com>
Date: Mon, 3 Mar 2008 08:59:50 -0000
I wasn't precise, sorry for that. Hooks works fine since it prevent to modify any properties but it doesn't display information I put in the echo command...
I'm on solaris 9 with old version of SVN 1.2.1
Regards
-- Piotr Stawiszyński Configuration Manager Sabre Airline Products & Services Sabre Development Center Krakow Poland -----Original Message----- From: Ryan Schmidt [mailto:subversion-2008a_at_ryandesign.com] Sent: Friday, February 29, 2008 8:00 PM To: Stawiszynski, Piotr Cc: users_at_subversion.tigris.org Subject: Re: pre-revprop-change hook problem On Feb 29, 2008, at 08:01, Stawiszynski, Piotr wrote: > I would like to show some information to the users when this hook > failed. In pre-commit hook I send message to STDERR and user can > see why commit failed. I would like to do the same in case of > properies change. > > Any advise? > > What I tried is: > > Excerpt from pre-revprop-change > > if [ "$ACTION" == "M" -a "$PROPNAME" == "svn:log" ]; then exit 0; fi > exec 1>&2 > echo "Changing revision properties other than svn:log by user other > than admin is prohibited" > exit 1 > > But it doesn't work :( The file pre-revprop-change.tmpl created in the hooks directory of an empty repository contains this: ----------------------------- #!/bin/sh 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 ----------------------------- This script worked for me. It allowed me to modify svn:log but didn't allow me to modify svn:date, for example. You didn't provide your full script, but I tried this: ----------------------------- #!/bin/sh REPOS="$1" REV="$2" USER="$3" PROPNAME="$4" ACTION="$5" if [ "$ACTION" == "M" -a "$PROPNAME" == "svn:log" ]; then exit 0; fi exec 1>&2 echo "Changing revision properties other than svn:log by user other than admin is prohibited" exit 1 ----------------------------- This also worked for me. In what way didn't it work for you? Does it prevent the commit but not output anything? Does it allow the commit to go through? What happens? Also what version of Subversion do you have and what OS are you running on? I'm on Mac OS X 10.4.11 Intel with Subversion 1.4.6. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org For additional commands, e-mail: users-help_at_subversion.tigris.orgReceived on 2008-03-03 10:00:23 CET |
This is an archived mail posted to the Subversion Users mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.