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

Re: pre-revprop-change hook problem

From: Ryan Schmidt <subversion-2008a_at_ryandesign.com>
Date: Fri, 29 Feb 2008 12:59:46 -0600

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.org
Received on 2008-02-29 20:00:49 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.