git-svn-id: https://svn.argeo.org/slc/trunk@673 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc
authorJérôme Conan <jerome.conan@capco.com>
Mon, 29 Oct 2007 15:27:49 +0000 (15:27 +0000)
committerJérôme Conan <jerome.conan@capco.com>
Mon, 29 Oct 2007 15:27:49 +0000 (15:27 +0000)
23 files changed:
org.argeo.slc/README.txt [new file with mode: 0644]
org.argeo.slc/conf/authz [new file with mode: 0644]
org.argeo.slc/conf/passwd [new file with mode: 0644]
org.argeo.slc/conf/svnserve.conf [new file with mode: 0644]
org.argeo.slc/db/current [new file with mode: 0644]
org.argeo.slc/db/format [new file with mode: 0644]
org.argeo.slc/db/fs-type [new file with mode: 0644]
org.argeo.slc/db/revprops/0 [new file with mode: 0644]
org.argeo.slc/db/revs/0 [new file with mode: 0644]
org.argeo.slc/db/uuid [new file with mode: 0644]
org.argeo.slc/db/write-lock [new file with mode: 0644]
org.argeo.slc/format [new file with mode: 0644]
org.argeo.slc/hooks/post-commit.tmpl [new file with mode: 0644]
org.argeo.slc/hooks/post-lock.tmpl [new file with mode: 0644]
org.argeo.slc/hooks/post-revprop-change.tmpl [new file with mode: 0644]
org.argeo.slc/hooks/post-unlock.tmpl [new file with mode: 0644]
org.argeo.slc/hooks/pre-commit.tmpl [new file with mode: 0644]
org.argeo.slc/hooks/pre-lock.tmpl [new file with mode: 0644]
org.argeo.slc/hooks/pre-revprop-change.tmpl [new file with mode: 0644]
org.argeo.slc/hooks/pre-unlock.tmpl [new file with mode: 0644]
org.argeo.slc/hooks/start-commit.tmpl [new file with mode: 0644]
org.argeo.slc/locks/db-logs.lock [new file with mode: 0644]
org.argeo.slc/locks/db.lock [new file with mode: 0644]

diff --git a/org.argeo.slc/README.txt b/org.argeo.slc/README.txt
new file mode 100644 (file)
index 0000000..c93ca33
--- /dev/null
@@ -0,0 +1,5 @@
+This is a Subversion repository; use the 'svnadmin' tool to examine\r
+it.  Do not add, delete, or modify files here unless you know how\r
+to avoid corrupting the repository.\r
+\r
+Visit http://subversion.tigris.org/ for more information.\r
diff --git a/org.argeo.slc/conf/authz b/org.argeo.slc/conf/authz
new file mode 100644 (file)
index 0000000..3407445
--- /dev/null
@@ -0,0 +1,21 @@
+### This file is an example authorization file for svnserve.\r
+### Its format is identical to that of mod_authz_svn authorization\r
+### files.\r
+### As shown below each section defines authorizations for the path and\r
+### (optional) repository specified by the section name.\r
+### The authorizations follow. An authorization line can refer to a\r
+### single user, to a group of users defined in a special [groups]\r
+### section, or to anyone using the '*' wildcard.  Each definition can\r
+### grant read ('r') access, read-write ('rw') access, or no access\r
+### ('').\r
+\r
+[groups]\r
+# harry_and_sally = harry,sally\r
+\r
+# [/foo/bar]\r
+# harry = rw\r
+# * =\r
+\r
+# [repository:/baz/fuz]\r
+# @harry_and_sally = rw\r
+# * = r\r
diff --git a/org.argeo.slc/conf/passwd b/org.argeo.slc/conf/passwd
new file mode 100644 (file)
index 0000000..d22bafc
--- /dev/null
@@ -0,0 +1,8 @@
+### This file is an example password file for svnserve.\r
+### Its format is similar to that of svnserve.conf. As shown in the\r
+### example below it contains one section labelled [users].\r
+### The name and password for each user follow, one account per line.\r
+\r
+[users]\r
+# harry = harryssecret\r
+# sally = sallyssecret\r
diff --git a/org.argeo.slc/conf/svnserve.conf b/org.argeo.slc/conf/svnserve.conf
new file mode 100644 (file)
index 0000000..089b0d0
--- /dev/null
@@ -0,0 +1,30 @@
+### This file controls the configuration of the svnserve daemon, if you\r
+### use it to allow access to this repository.  (If you only allow\r
+### access through http: and/or file: URLs, then this file is\r
+### irrelevant.)\r
+\r
+### Visit http://subversion.tigris.org/ for more information.\r
+\r
+[general]\r
+### These options control access to the repository for unauthenticated\r
+### and authenticated users.  Valid values are "write", "read",\r
+### and "none".  The sample settings below are the defaults.\r
+# anon-access = read\r
+# auth-access = write\r
+### The password-db option controls the location of the password\r
+### database file.  Unless you specify a path starting with a /,\r
+### the file's location is relative to the conf directory.\r
+### Uncomment the line below to use the default password file.\r
+# password-db = passwd\r
+### The authz-db option controls the location of the authorization\r
+### rules for path-based access control.  Unless you specify a path\r
+### starting with a /, the file's location is relative to the conf\r
+### directory.  If you don't specify an authz-db, no path-based access\r
+### control is done.\r
+### Uncomment the line below to use the default authorization file.\r
+# authz-db = authz\r
+### This option specifies the authentication realm of the repository.\r
+### If two repositories have the same authentication realm, they should\r
+### have the same password database, and vice versa.  The default realm\r
+### is repository's uuid.\r
+# realm = My First Repository\r
diff --git a/org.argeo.slc/db/current b/org.argeo.slc/db/current
new file mode 100644 (file)
index 0000000..c435b76
--- /dev/null
@@ -0,0 +1 @@
+0 1 1
diff --git a/org.argeo.slc/db/format b/org.argeo.slc/db/format
new file mode 100644 (file)
index 0000000..0cfbf08
--- /dev/null
@@ -0,0 +1 @@
+2
diff --git a/org.argeo.slc/db/fs-type b/org.argeo.slc/db/fs-type
new file mode 100644 (file)
index 0000000..4fdd953
--- /dev/null
@@ -0,0 +1 @@
+fsfs
diff --git a/org.argeo.slc/db/revprops/0 b/org.argeo.slc/db/revprops/0
new file mode 100644 (file)
index 0000000..ced4898
--- /dev/null
@@ -0,0 +1,5 @@
+K 8
+svn:date
+V 27
+2007-10-29T14:39:08.105229Z
+END
diff --git a/org.argeo.slc/db/revs/0 b/org.argeo.slc/db/revs/0
new file mode 100644 (file)
index 0000000..10f5c45
--- /dev/null
@@ -0,0 +1,11 @@
+PLAIN
+END
+ENDREP
+id: 0.0.r0/17
+type: dir
+count: 0
+text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
+cpath: /
+
+
+17 107
diff --git a/org.argeo.slc/db/uuid b/org.argeo.slc/db/uuid
new file mode 100644 (file)
index 0000000..7700336
--- /dev/null
@@ -0,0 +1 @@
+95536009-7d9e-ba44-b839-7e68f41a0c17
diff --git a/org.argeo.slc/db/write-lock b/org.argeo.slc/db/write-lock
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/org.argeo.slc/format b/org.argeo.slc/format
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/org.argeo.slc/hooks/post-commit.tmpl b/org.argeo.slc/hooks/post-commit.tmpl
new file mode 100644 (file)
index 0000000..c1bfc35
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh\r
+\r
+# POST-COMMIT HOOK\r
+#\r
+# The post-commit hook is invoked after a commit.  Subversion runs\r
+# this hook by invoking a program (script, executable, binary, etc.)\r
+# named 'post-commit' (for which this file is a template) with the \r
+# following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] REV          (the number of the revision just committed)\r
+#\r
+# The default working directory for the invocation is undefined, so\r
+# the program should set one explicitly if it cares.\r
+#\r
+# Because the commit has already completed and cannot be undone,\r
+# the exit code of the hook program is ignored.  The hook program\r
+# can use the 'svnlook' utility to help it examine the\r
+# newly-committed tree.\r
+#\r
+# On a Unix system, the normal procedure is to have 'post-commit'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'post-commit' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'post-commit.bat' or 'post-commit.exe',\r
+# but the basic idea is the same.\r
+# \r
+# The hook program typically does not inherit the environment of\r
+# its parent process.  For example, a common problem is for the\r
+# PATH environment variable to not be set to its usual value, so\r
+# that subprograms fail to launch unless invoked via absolute path.\r
+# If you're having unexpected problems with a hook program, the\r
+# culprit may be unusual (or missing) environment variables.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter.\r
+# For more examples and pre-written hooks, see those in\r
+# the Subversion repository at\r
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and\r
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/\r
+\r
+\r
+REPOS="$1"\r
+REV="$2"\r
+\r
+commit-email.pl "$REPOS" "$REV" commit-watchers@example.org\r
+log-commit.py --repository "$REPOS" --revision "$REV"\r
diff --git a/org.argeo.slc/hooks/post-lock.tmpl b/org.argeo.slc/hooks/post-lock.tmpl
new file mode 100644 (file)
index 0000000..65a7d40
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh\r
+\r
+# POST-LOCK HOOK\r
+#\r
+# The post-lock hook is run after a path is locked.  Subversion runs\r
+# this hook by invoking a program (script, executable, binary, etc.)\r
+# named 'post-lock' (for which this file is a template) with the \r
+# following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] USER         (the user who created the lock)\r
+#\r
+# The paths that were just locked are passed to the hook via STDIN (as\r
+# of Subversion 1.2, only one path is passed per invocation, but the\r
+# plan is to pass all locked paths at once, so the hook program\r
+# should be written accordingly).\r
+#\r
+# The default working directory for the invocation is undefined, so\r
+# the program should set one explicitly if it cares.\r
+#\r
+# Because the lock has already been created and cannot be undone,\r
+# the exit code of the hook program is ignored.  The hook program\r
+# can use the 'svnlook' utility to help it examine the\r
+# newly-created lock.\r
+#\r
+# On a Unix system, the normal procedure is to have 'post-lock'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'post-lock' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'post-lock.bat' or 'post-lock.exe',\r
+# but the basic idea is the same.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter:\r
+\r
+REPOS="$1"\r
+USER="$2"\r
+\r
+# Send email to interested parties, let them know a lock was created:\r
+mailer.py lock "$REPOS" "$USER" /path/to/mailer.conf\r
diff --git a/org.argeo.slc/hooks/post-revprop-change.tmpl b/org.argeo.slc/hooks/post-revprop-change.tmpl
new file mode 100644 (file)
index 0000000..395201a
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/sh\r
+\r
+# POST-REVPROP-CHANGE HOOK\r
+#\r
+# The post-revprop-change hook is invoked after a revision property\r
+# has been added, modified or deleted.  Subversion runs this hook by\r
+# invoking a program (script, executable, binary, etc.) named\r
+# 'post-revprop-change' (for which this file is a template), with the\r
+# following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] REV          (the revision that was tweaked)\r
+#   [3] USER         (the username of the person tweaking the property)\r
+#   [4] PROPNAME     (the property that was changed)\r
+#   [5] ACTION       (the property was 'A'dded, 'M'odified, or 'D'eleted)\r
+#\r
+#   [STDIN] PROPVAL  ** the old property value is passed via STDIN.\r
+#\r
+# Because the propchange has already completed and cannot be undone,\r
+# the exit code of the hook program is ignored.  The hook program\r
+# can use the 'svnlook' utility to help it examine the\r
+# new property value.\r
+#\r
+# On a Unix system, the normal procedure is to have 'post-revprop-change'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'post-revprop-change' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'post-revprop-change.bat' or 'post-revprop-change.exe',\r
+# but the basic idea is the same.\r
+# \r
+# The hook program typically does not inherit the environment of\r
+# its parent process.  For example, a common problem is for the\r
+# PATH environment variable to not be set to its usual value, so\r
+# that subprograms fail to launch unless invoked via absolute path.\r
+# If you're having unexpected problems with a hook program, the\r
+# culprit may be unusual (or missing) environment variables.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter.\r
+# For more examples and pre-written hooks, see those in\r
+# the Subversion repository at\r
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and\r
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/\r
+\r
+\r
+REPOS="$1"\r
+REV="$2"\r
+USER="$3"\r
+PROPNAME="$4"\r
+ACTION="$5"\r
+\r
+propchange-email.pl "$REPOS" "$REV" "$USER" "$PROPNAME" watchers@example.org\r
diff --git a/org.argeo.slc/hooks/post-unlock.tmpl b/org.argeo.slc/hooks/post-unlock.tmpl
new file mode 100644 (file)
index 0000000..5821be8
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh\r
+\r
+# POST-UNLOCK HOOK\r
+#\r
+# The post-unlock hook runs after a path is unlocked.  Subversion runs\r
+# this hook by invoking a program (script, executable, binary, etc.)\r
+# named 'post-unlock' (for which this file is a template) with the \r
+# following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] USER         (the user who destroyed the lock)\r
+#\r
+# The paths that were just unlocked are passed to the hook via STDIN\r
+# (as of Subversion 1.2, only one path is passed per invocation, but\r
+# the plan is to pass all unlocked paths at once, so the hook program\r
+# should be written accordingly).\r
+#\r
+# The default working directory for the invocation is undefined, so\r
+# the program should set one explicitly if it cares.\r
+#\r
+# Because the lock has already been destroyed and cannot be undone,\r
+# the exit code of the hook program is ignored.\r
+#\r
+# On a Unix system, the normal procedure is to have 'post-unlock'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'post-unlock' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'post-unlock.bat' or 'post-unlock.exe',\r
+# but the basic idea is the same.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter:\r
+\r
+REPOS="$1"\r
+USER="$2"\r
+\r
+# Send email to interested parties, let them know a lock was removed:\r
+mailer.py unlock "$REPOS" "$USER" /path/to/mailer.conf\r
diff --git a/org.argeo.slc/hooks/pre-commit.tmpl b/org.argeo.slc/hooks/pre-commit.tmpl
new file mode 100644 (file)
index 0000000..4ac8669
--- /dev/null
@@ -0,0 +1,70 @@
+#!/bin/sh\r
+\r
+# PRE-COMMIT HOOK\r
+#\r
+# The pre-commit hook is invoked before a Subversion txn is\r
+# committed.  Subversion runs this hook by invoking a program\r
+# (script, executable, binary, etc.) named 'pre-commit' (for which\r
+# this file is a template), with the following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] TXN-NAME     (the name of the txn about to be committed)\r
+#\r
+# The default working directory for the invocation is undefined, so\r
+# the program should set one explicitly if it cares.\r
+#\r
+# If the hook program exits with success, the txn is committed; but\r
+# if it exits with failure (non-zero), the txn is aborted, no commit\r
+# takes place, and STDERR is returned to the client.   The hook\r
+# program can use the 'svnlook' utility to help it examine the txn.\r
+#\r
+# On a Unix system, the normal procedure is to have 'pre-commit'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+#   ***  NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT  ***\r
+#   ***  FOR REVISION PROPERTIES (like svn:log or svn:author).   ***\r
+#\r
+#   This is why we recommend using the read-only 'svnlook' utility.\r
+#   In the future, Subversion may enforce the rule that pre-commit\r
+#   hooks should not modify the versioned data in txns, or else come\r
+#   up with a mechanism to make it safe to do so (by informing the\r
+#   committing client of the changes).  However, right now neither\r
+#   mechanism is implemented, so hook writers just have to be careful.\r
+#\r
+# Note that 'pre-commit' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'pre-commit.bat' or 'pre-commit.exe',\r
+# but the basic idea is the same.\r
+#\r
+# The hook program typically does not inherit the environment of\r
+# its parent process.  For example, a common problem is for the\r
+# PATH environment variable to not be set to its usual value, so\r
+# that subprograms fail to launch unless invoked via absolute path.\r
+# If you're having unexpected problems with a hook program, the\r
+# culprit may be unusual (or missing) environment variables.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter.\r
+# For more examples and pre-written hooks, see those in\r
+# the Subversion repository at\r
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and\r
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/\r
+\r
+\r
+REPOS="$1"\r
+TXN="$2"\r
+\r
+# Make sure that the log message contains some text.\r
+SVNLOOK=/usr/local/bin/svnlook\r
+$SVNLOOK log -t "$TXN" "$REPOS" | \\r
+   grep "[a-zA-Z0-9]" > /dev/null || exit 1\r
+\r
+# Check that the author of this commit has the rights to perform\r
+# the commit on the files and directories being modified.\r
+commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1\r
+\r
+# All checks passed, so allow the commit.\r
+exit 0\r
diff --git a/org.argeo.slc/hooks/pre-lock.tmpl b/org.argeo.slc/hooks/pre-lock.tmpl
new file mode 100644 (file)
index 0000000..f4c43d2
--- /dev/null
@@ -0,0 +1,64 @@
+#!/bin/sh\r
+\r
+# PRE-LOCK HOOK\r
+#\r
+# The pre-lock hook is invoked before an exclusive lock is\r
+# created.  Subversion runs this hook by invoking a program \r
+# (script, executable, binary, etc.) named 'pre-lock' (for which\r
+# this file is a template), with the following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] PATH         (the path in the repository about to be locked)\r
+#   [3] USER         (the user creating the lock)\r
+#\r
+# The default working directory for the invocation is undefined, so\r
+# the program should set one explicitly if it cares.\r
+#\r
+# If the hook program exits with success, the lock is created; but\r
+# if it exits with failure (non-zero), the lock action is aborted\r
+# and STDERR is returned to the client.\r
+\r
+# On a Unix system, the normal procedure is to have 'pre-lock'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'pre-lock' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'pre-lock.bat' or 'pre-lock.exe',\r
+# but the basic idea is the same.\r
+#\r
+# Here is an example hook script, for a Unix /bin/sh interpreter:\r
+\r
+REPOS="$1"\r
+PATH="$2"\r
+USER="$3"\r
+\r
+# If a lock exists and is owned by a different person, don't allow it\r
+# to be stolen (e.g., with 'svn lock --force ...').\r
+\r
+# (Maybe this script could send email to the lock owner?)\r
+SVNLOOK=/usr/local/bin/svnlook\r
+GREP=/bin/grep\r
+SED=/bin/sed\r
+\r
+LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \\r
+            $GREP '^Owner: ' | $SED 's/Owner: //'`\r
+\r
+# If we get no result from svnlook, there's no lock, allow the lock to\r
+# happen:\r
+if [ "$LOCK_OWNER" = "" ]; then\r
+  exit 0\r
+fi\r
+\r
+# If the person locking matches the lock's owner, allow the lock to\r
+# happen:\r
+if [ "$LOCK_OWNER" = "$USER" ]; then\r
+  exit 0\r
+fi\r
+\r
+# Otherwise, we've got an owner mismatch, so return failure:\r
+echo "Error: $PATH already locked by ${LOCK_OWNER}." 1>&2\r
+exit 1\r
diff --git a/org.argeo.slc/hooks/pre-revprop-change.tmpl b/org.argeo.slc/hooks/pre-revprop-change.tmpl
new file mode 100644 (file)
index 0000000..9e284a9
--- /dev/null
@@ -0,0 +1,66 @@
+#!/bin/sh\r
+\r
+# PRE-REVPROP-CHANGE HOOK\r
+#\r
+# The pre-revprop-change hook is invoked before a revision property\r
+# is added, modified or deleted.  Subversion runs this hook by invoking\r
+# a program (script, executable, binary, etc.) named 'pre-revprop-change'\r
+# (for which this file is a template), with the following ordered\r
+# arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] REVISION     (the revision being tweaked)\r
+#   [3] USER         (the username of the person tweaking the property)\r
+#   [4] PROPNAME     (the property being set on the revision)\r
+#   [5] ACTION       (the property is being 'A'dded, 'M'odified, or 'D'eleted)\r
+#\r
+#   [STDIN] PROPVAL  ** the new property value is passed via STDIN.\r
+#\r
+# If the hook program exits with success, the propchange happens; but\r
+# if it exits with failure (non-zero), the propchange doesn't happen.\r
+# The hook program can use the 'svnlook' utility to examine the \r
+# existing value of the revision property.\r
+#\r
+# WARNING: unlike other hooks, this hook MUST exist for revision\r
+# properties to be changed.  If the hook does not exist, Subversion \r
+# will behave as if the hook were present, but failed.  The reason\r
+# for this is that revision properties are UNVERSIONED, meaning that\r
+# a successful propchange is destructive;  the old value is gone\r
+# forever.  We recommend the hook back up the old value somewhere.\r
+#\r
+# On a Unix system, the normal procedure is to have 'pre-revprop-change'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'pre-revprop-change' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'pre-revprop-change.bat' or 'pre-revprop-change.exe',\r
+# but the basic idea is the same.\r
+#\r
+# The hook program typically does not inherit the environment of\r
+# its parent process.  For example, a common problem is for the\r
+# PATH environment variable to not be set to its usual value, so\r
+# that subprograms fail to launch unless invoked via absolute path.\r
+# If you're having unexpected problems with a hook program, the\r
+# culprit may be unusual (or missing) environment variables.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter.\r
+# For more examples and pre-written hooks, see those in\r
+# the Subversion repository at\r
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and\r
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/\r
+\r
+\r
+REPOS="$1"\r
+REV="$2"\r
+USER="$3"\r
+PROPNAME="$4"\r
+ACTION="$5"\r
+\r
+if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi\r
+\r
+echo "Changing revision properties other than svn:log is prohibited" >&2\r
+exit 1\r
diff --git a/org.argeo.slc/hooks/pre-unlock.tmpl b/org.argeo.slc/hooks/pre-unlock.tmpl
new file mode 100644 (file)
index 0000000..1298e80
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/sh\r
+\r
+# PRE-UNLOCK HOOK\r
+#\r
+# The pre-unlock hook is invoked before an exclusive lock is\r
+# destroyed.  Subversion runs this hook by invoking a program \r
+# (script, executable, binary, etc.) named 'pre-unlock' (for which\r
+# this file is a template), with the following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] PATH         (the path in the repository about to be unlocked)\r
+#   [3] USER         (the user destroying the lock)\r
+#\r
+# The default working directory for the invocation is undefined, so\r
+# the program should set one explicitly if it cares.\r
+#\r
+# If the hook program exits with success, the lock is destroyed; but\r
+# if it exits with failure (non-zero), the unlock action is aborted\r
+# and STDERR is returned to the client.\r
+\r
+# On a Unix system, the normal procedure is to have 'pre-unlock'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'pre-unlock' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'pre-unlock.bat' or 'pre-unlock.exe',\r
+# but the basic idea is the same.\r
+#\r
+# Here is an example hook script, for a Unix /bin/sh interpreter:\r
+\r
+REPOS="$1"\r
+PATH="$2"\r
+USER="$3"\r
+\r
+# If a lock is owned by a different person, don't allow it be broken.\r
+# (Maybe this script could send email to the lock owner?)\r
+\r
+SVNLOOK=/usr/local/bin/svnlook\r
+GREP=/bin/grep\r
+SED=/bin/sed\r
+\r
+LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \\r
+            $GREP '^Owner: ' | $SED 's/Owner: //'`\r
+\r
+# If we get no result from svnlook, there's no lock, return success:\r
+if [ "$LOCK_OWNER" = "" ]; then\r
+  exit 0\r
+fi\r
+# If the person unlocking matches the lock's owner, return success:\r
+if [ "$LOCK_OWNER" = "$USER" ]; then\r
+  exit 0\r
+fi\r
+\r
+# Otherwise, we've got an owner mismatch, so return failure:\r
+echo "Error: $PATH locked by ${LOCK_OWNER}." 1>&2\r
+exit 1\r
diff --git a/org.argeo.slc/hooks/start-commit.tmpl b/org.argeo.slc/hooks/start-commit.tmpl
new file mode 100644 (file)
index 0000000..e770748
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/sh\r
+\r
+# START-COMMIT HOOK\r
+#\r
+# The start-commit hook is invoked before a Subversion txn is created\r
+# in the process of doing a commit.  Subversion runs this hook\r
+# by invoking a program (script, executable, binary, etc.) named\r
+# 'start-commit' (for which this file is a template)\r
+# with the following ordered arguments:\r
+#\r
+#   [1] REPOS-PATH   (the path to this repository)\r
+#   [2] USER         (the authenticated user attempting to commit)\r
+#\r
+# The default working directory for the invocation is undefined, so\r
+# the program should set one explicitly if it cares.\r
+#\r
+# If the hook program exits with success, the commit continues; but\r
+# if it exits with failure (non-zero), the commit is stopped before\r
+# a Subversion txn is created, and STDERR is returned to the client.\r
+#\r
+# On a Unix system, the normal procedure is to have 'start-commit'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# Note that 'start-commit' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'start-commit.bat' or 'start-commit.exe',\r
+# but the basic idea is the same.\r
+# \r
+# The hook program typically does not inherit the environment of\r
+# its parent process.  For example, a common problem is for the\r
+# PATH environment variable to not be set to its usual value, so\r
+# that subprograms fail to launch unless invoked via absolute path.\r
+# If you're having unexpected problems with a hook program, the\r
+# culprit may be unusual (or missing) environment variables.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter.\r
+# For more examples and pre-written hooks, see those in\r
+# the Subversion repository at\r
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and\r
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/\r
+\r
+\r
+REPOS="$1"\r
+USER="$2"\r
+\r
+commit-allower.pl --repository "$REPOS" --user "$USER" || exit 1\r
+special-auth-check.py --user "$USER" --auth-level 3 || exit 1\r
+\r
+# All checks passed, so allow the commit.\r
+exit 0\r
diff --git a/org.argeo.slc/locks/db-logs.lock b/org.argeo.slc/locks/db-logs.lock
new file mode 100644 (file)
index 0000000..536ac36
--- /dev/null
@@ -0,0 +1,3 @@
+This file is not used by Subversion 1.3.x or later.\r
+However, its existence is required for compatibility with\r
+Subversion 1.2.x or earlier.\r
diff --git a/org.argeo.slc/locks/db.lock b/org.argeo.slc/locks/db.lock
new file mode 100644 (file)
index 0000000..536ac36
--- /dev/null
@@ -0,0 +1,3 @@
+This file is not used by Subversion 1.3.x or later.\r
+However, its existence is required for compatibility with\r
+Subversion 1.2.x or earlier.\r