Ticket #1374: pre-revprop-change.txt

File pre-revprop-change.txt, 0.9 kB (added by prasand, 2 years ago)

SVN Hook script.

Line 
1 #!/bin/bash
2
3 # PRE-REVPROP-CHANGE HOOK
4 #
5 # The pre-revprop-change hook is invoked before a revision property
6 # is added, modified or deleted.  Subversion runs this hook by invoking
7 # a program (script, executable, binary, etc.) named 'pre-revprop-change'
8 # (for which this file is a template), with the following ordered
9 # arguments:
10 #
11 #   [1] REPOS-PATH   (the path to this repository)
12 #   [2] REVISION     (the revision being tweaked)
13 #   [3] USER         (the username of the person tweaking the property)
14 #   [4] PROPNAME     (the property being set on the revision)
15 #   [5] ACTION       (the property is being 'A'dded, 'M'odified, or 'D'eleted)
16 #
17 #   [STDIN] PROPVAL  ** the new property value is passed via STDIN.
18 #
19
20
21 REPOS="$1"
22 REV="$2"
23 USER="$3"
24 PROPNAME="$4"
25 ACTION="$5"
26
27 if [ "$ACTION" = "M" ]; then
28         if [ "$PROPNAME" = "svn:log" ] || [ "$PROPNAME" = "svn:author" ]; then
29                 exit 0;
30         fi
31 fi
32
33 echo "You may only 'edit' the log & author properties"
34 exit 1