/[pkg-subversion]/hooks/pre-revprop-change
ViewVC logotype

Contents of /hooks/pre-revprop-change

Parent Directory Parent Directory | Revision Log Revision Log


Revision 487 - (show annotations) (download)
Sat Jan 14 09:02:05 2006 UTC (7 years, 5 months ago) by peters-guest
File size: 1952 byte(s)
Copy pre-revprop-change from pre-revprop-change.tmpl.

The default script looks fine: allow changing svn:log, but not others.
(svn:log is the only revprop I ever seem to want to change.)
1 #!/bin/sh
2
3 # PRE-REVPROP-CHANGE HOOK
4 #
5 # The pre-revprop-change hook is invoked before a revision property
6 # is modified. Subversion runs this hook by invoking a program
7 # (script, executable, binary, etc.) named 'pre-revprop-change' (for which
8 # this file is a template), with the following ordered arguments:
9 #
10 # [1] REPOS-PATH (the path to this repository)
11 # [2] REVISION (the revision being tweaked)
12 # [3] USER (the username of the person tweaking the property)
13 # [4] PROPNAME (the property being set on the revision)
14 #
15 # [STDIN] PROPVAL ** the property value is passed via STDIN.
16 #
17 # If the hook program exits with success, the propchange happens; but
18 # if it exits with failure (non-zero), the propchange doesn't happen.
19 # The hook program can use the 'svnlook' utility to examine the
20 # existing value of the revision property.
21 #
22 # WARNING: unlike other hooks, this hook MUST exist for revision
23 # properties to be changed. If the hook does not exist, Subversion
24 # will behave as if the hook were present, but failed. The reason
25 # for this is that revision properties are UNVERSIONED, meaning that
26 # a successful propchange is destructive; the old value is gone
27 # forever. We recommend the hook back up the old value somewhere.
28 #
29 # On a Unix system, the normal procedure is to have 'pre-revprop-change'
30 # invoke other programs to do the real work, though it may do the
31 # work itself too.
32 #
33 # Note that 'pre-revprop-change' must be executable by the user(s) who will
34 # invoke it (typically the user httpd runs as), and that user must
35 # have filesystem-level permission to access the repository.
36 #
37 # On a Windows system, you should name the hook program
38 # 'pre-revprop-change.bat' or 'pre-revprop-change.exe',
39 # but the basic idea is the same.
40 #
41 # Here is an example hook script, for a Unix /bin/sh interpreter:
42
43 REPOS="$1"
44 REV="$2"
45 USER="$3"
46 PROPNAME="$4"
47
48 if [ "$PROPNAME" = "svn:log" ]; then exit 0; fi
49 exit 1

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5