diff --git a/NEWS.mdtext b/NEWS.mdtext index a2971d9..b404543 100644 --- a/NEWS.mdtext +++ b/NEWS.mdtext @@ -16,7 +16,7 @@ or newer to properly run this version of Indefero! ## Bugfixes -- The SVN interface acts more robust if an underlying repository has been restructured (issue 364) +- The SVN interface acts more robust if an underlying repository has been restructured (issues 364 and 721) - monotone zip archive entries now all carry the revision date as mtime (issue 645) - Timeline only displays filter options for items a user has actually access to (issue 655) - The log, tags and branches parsers for Mercurial are more robust now (issue 663) diff --git a/test/IDF/Scm/SvnTest.php b/test/IDF/Scm/SvnTest.php index 46f11ab..6361667 100644 --- a/test/IDF/Scm/SvnTest.php +++ b/test/IDF/Scm/SvnTest.php @@ -38,17 +38,18 @@ class IDF_Scm_SvnTest extends PHPUnit_Framework_TestCase $this->proj->delete(); } - public function createMock() + public function createMock($reponame) { - $instance = new IDF_Scm_Svn(sprintf(Pluf::f('svn_repositories'),'testrepository', $this->proj)); + $repourl = 'file://'.DATADIR.'/'.__CLASS__.'/'.$reponame; + $instance = new IDF_Scm_Svn($repourl, $this->proj); return $instance; } public function testAccessHistoryOfRenamedAndDeletedFiles() { - $instance = $this->createMock(); - $this->assertEquals('new-file', $instance->getPathInfo('new-file', 1)->fullpath); - $this->assertEquals('alternate-name', $instance->getPathInfo('alternate-name', 2)->fullpath); + $instance = $this->createMock(__FUNCTION__); + $this->assertEquals('new-file', $instance->getPathInfo('new-file', 1)->fullpath); + $this->assertEquals('alternate-name', $instance->getPathInfo('alternate-name', 2)->fullpath); } } diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/current b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/current similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/current rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/current diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/format b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/format similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/format rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/format diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/fs-type b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/fs-type similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/fs-type rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/fs-type diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/fsfs.conf b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/fsfs.conf similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/fsfs.conf rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/fsfs.conf diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/min-unpacked-rev b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/min-unpacked-rev similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/min-unpacked-rev rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/min-unpacked-rev diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/rep-cache.db b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/rep-cache.db similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/rep-cache.db rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/rep-cache.db diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/revprops/0/0 b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revprops/0/0 similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/revprops/0/0 rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revprops/0/0 diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/revprops/0/1 b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revprops/0/1 similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/revprops/0/1 rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revprops/0/1 diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/revprops/0/2 b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revprops/0/2 similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/revprops/0/2 rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revprops/0/2 diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/revprops/0/3 b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revprops/0/3 similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/revprops/0/3 rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revprops/0/3 diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/revs/0/0 b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revs/0/0 similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/revs/0/0 rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revs/0/0 diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/revs/0/1 b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revs/0/1 similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/revs/0/1 rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revs/0/1 diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/revs/0/2 b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revs/0/2 similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/revs/0/2 rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revs/0/2 diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/revs/0/3 b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revs/0/3 similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/revs/0/3 rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/revs/0/3 diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/txn-current b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/txn-current similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/txn-current rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/txn-current diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/txn-current-lock b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/txn-current-lock similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/txn-current-lock rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/txn-current-lock diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/uuid b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/uuid similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/uuid rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/uuid diff --git a/test/data/IDF_Scm_SvnTest/testrepository/db/write-lock b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/write-lock similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/db/write-lock rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/db/write-lock diff --git a/test/data/IDF_Scm_SvnTest/testrepository/format b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/format similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/format rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/format diff --git a/test/data/IDF_Scm_SvnTest/testrepository/locks/db-logs.lock b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/locks/db-logs.lock similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/locks/db-logs.lock rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/locks/db-logs.lock diff --git a/test/data/IDF_Scm_SvnTest/testrepository/locks/db.lock b/test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/locks/db.lock similarity index 100% rename from test/data/IDF_Scm_SvnTest/testrepository/locks/db.lock rename to test/data/IDF_Scm_SvnTest/testAccessHistoryOfRenamedAndDeletedFiles/locks/db.lock diff --git a/test/data/IDF_Scm_SvnTest/testrepository/README.txt b/test/data/IDF_Scm_SvnTest/testrepository/README.txt deleted file mode 100644 index 3bf5a57..0000000 --- a/test/data/IDF_Scm_SvnTest/testrepository/README.txt +++ /dev/null @@ -1,5 +0,0 @@ -This is a Subversion repository; use the 'svnadmin' tool to examine -it. Do not add, delete, or modify files here unless you know how -to avoid corrupting the repository. - -Visit http://subversion.tigris.org/ for more information. diff --git a/test/data/IDF_Scm_SvnTest/testrepository/conf/authz b/test/data/IDF_Scm_SvnTest/testrepository/conf/authz deleted file mode 100644 index 0b9a410..0000000 --- a/test/data/IDF_Scm_SvnTest/testrepository/conf/authz +++ /dev/null @@ -1,32 +0,0 @@ -### This file is an example authorization file for svnserve. -### Its format is identical to that of mod_authz_svn authorization -### files. -### As shown below each section defines authorizations for the path and -### (optional) repository specified by the section name. -### The authorizations follow. An authorization line can refer to: -### - a single user, -### - a group of users defined in a special [groups] section, -### - an alias defined in a special [aliases] section, -### - all authenticated users, using the '$authenticated' token, -### - only anonymous users, using the '$anonymous' token, -### - anyone, using the '*' wildcard. -### -### A match can be inverted by prefixing the rule with '~'. Rules can -### grant read ('r') access, read-write ('rw') access, or no access -### (''). - -[aliases] -# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average - -[groups] -# harry_and_sally = harry,sally -# harry_sally_and_joe = harry,sally,&joe - -# [/foo/bar] -# harry = rw -# &joe = r -# * = - -# [repository:/baz/fuz] -# @harry_and_sally = rw -# * = r diff --git a/test/data/IDF_Scm_SvnTest/testrepository/conf/passwd b/test/data/IDF_Scm_SvnTest/testrepository/conf/passwd deleted file mode 100644 index ecaa08d..0000000 --- a/test/data/IDF_Scm_SvnTest/testrepository/conf/passwd +++ /dev/null @@ -1,8 +0,0 @@ -### This file is an example password file for svnserve. -### Its format is similar to that of svnserve.conf. As shown in the -### example below it contains one section labelled [users]. -### The name and password for each user follow, one account per line. - -[users] -# harry = harryssecret -# sally = sallyssecret diff --git a/test/data/IDF_Scm_SvnTest/testrepository/conf/svnserve.conf b/test/data/IDF_Scm_SvnTest/testrepository/conf/svnserve.conf deleted file mode 100644 index e62a01e..0000000 --- a/test/data/IDF_Scm_SvnTest/testrepository/conf/svnserve.conf +++ /dev/null @@ -1,47 +0,0 @@ -### This file controls the configuration of the svnserve daemon, if you -### use it to allow access to this repository. (If you only allow -### access through http: and/or file: URLs, then this file is -### irrelevant.) - -### Visit http://subversion.tigris.org/ for more information. - -[general] -### These options control access to the repository for unauthenticated -### and authenticated users. Valid values are "write", "read", -### and "none". The sample settings below are the defaults. -# anon-access = read -# auth-access = write -### The password-db option controls the location of the password -### database file. Unless you specify a path starting with a /, -### the file's location is relative to the directory containing -### this configuration file. -### If SASL is enabled (see below), this file will NOT be used. -### Uncomment the line below to use the default password file. -# password-db = passwd -### The authz-db option controls the location of the authorization -### rules for path-based access control. Unless you specify a path -### starting with a /, the file's location is relative to the the -### directory containing this file. If you don't specify an -### authz-db, no path-based access control is done. -### Uncomment the line below to use the default authorization file. -# authz-db = authz -### This option specifies the authentication realm of the repository. -### If two repositories have the same authentication realm, they should -### have the same password database, and vice versa. The default realm -### is repository's uuid. -# realm = My First Repository - -[sasl] -### This option specifies whether you want to use the Cyrus SASL -### library for authentication. Default is false. -### This section will be ignored if svnserve is not built with Cyrus -### SASL support; to check, run 'svnserve --version' and look for a line -### reading 'Cyrus SASL authentication is available.' -# use-sasl = true -### These options specify the desired strength of the security layer -### that you want SASL to provide. 0 means no encryption, 1 means -### integrity-checking only, values larger than 1 are correlated -### to the effective key length for encryption (e.g. 128 means 128-bit -### encryption). The values below are the defaults. -# min-encryption = 0 -# max-encryption = 256 diff --git a/test/data/IDF_Scm_SvnTest/testrepository/hooks/post-commit.tmpl b/test/data/IDF_Scm_SvnTest/testrepository/hooks/post-commit.tmpl deleted file mode 100644 index 93c92ad..0000000 --- a/test/data/IDF_Scm_SvnTest/testrepository/hooks/post-commit.tmpl +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -# POST-COMMIT HOOK -# -# The post-commit hook is invoked after a commit. Subversion runs -# this hook by invoking a program (script, executable, binary, etc.) -# named 'post-commit' (for which this file is a template) with the -# following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] REV (the number of the revision just committed) -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# Because the commit has already completed and cannot be undone, -# the exit code of the hook program is ignored. The hook program -# can use the 'svnlook' utility to help it examine the -# newly-committed tree. -# -# On a Unix system, the normal procedure is to have 'post-commit' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'post-commit' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'post-commit.bat' or 'post-commit.exe', -# but the basic idea is the same. -# -# The hook program typically does not inherit the environment of -# its parent process. For example, a common problem is for the -# PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# /usr/share/subversion/hook-scripts, and in the repository at -# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and -# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ - - -REPOS="$1" -REV="$2" - -"$REPOS"/hooks/mailer.py commit "$REPOS" $REV "$REPOS"/mailer.conf diff --git a/test/data/IDF_Scm_SvnTest/testrepository/hooks/post-lock.tmpl b/test/data/IDF_Scm_SvnTest/testrepository/hooks/post-lock.tmpl deleted file mode 100644 index beae9d7..0000000 --- a/test/data/IDF_Scm_SvnTest/testrepository/hooks/post-lock.tmpl +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -# POST-LOCK HOOK -# -# The post-lock hook is run after a path is locked. Subversion runs -# this hook by invoking a program (script, executable, binary, etc.) -# named 'post-lock' (for which this file is a template) with the -# following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] USER (the user who created the lock) -# -# The paths that were just locked are passed to the hook via STDIN (as -# of Subversion 1.2, only one path is passed per invocation, but the -# plan is to pass all locked paths at once, so the hook program -# should be written accordingly). -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# Because the lock has already been created and cannot be undone, -# the exit code of the hook program is ignored. The hook program -# can use the 'svnlook' utility to help it examine the -# newly-created lock. -# -# On a Unix system, the normal procedure is to have 'post-lock' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'post-lock' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'post-lock.bat' or 'post-lock.exe', -# but the basic idea is the same. -# -# Here is an example hook script, for a Unix /bin/sh interpreter: - -REPOS="$1" -USER="$2" - -# Send email to interested parties, let them know a lock was created: -"$REPOS"/hooks/mailer.py lock \ - "$REPOS" "$USER" "$REPOS"/hooks/mailer.conf diff --git a/test/data/IDF_Scm_SvnTest/testrepository/hooks/post-revprop-change.tmpl b/test/data/IDF_Scm_SvnTest/testrepository/hooks/post-revprop-change.tmpl deleted file mode 100644 index cf7aedd..0000000 --- a/test/data/IDF_Scm_SvnTest/testrepository/hooks/post-revprop-change.tmpl +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh - -# POST-REVPROP-CHANGE HOOK -# -# The post-revprop-change hook is invoked after a revision property -# has been added, modified or deleted. Subversion runs this hook by -# invoking a program (script, executable, binary, etc.) named -# 'post-revprop-change' (for which this file is a template), with the -# following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] REV (the revision that was tweaked) -# [3] USER (the username of the person tweaking the property) -# [4] PROPNAME (the property that was changed) -# [5] ACTION (the property was 'A'dded, 'M'odified, or 'D'eleted) -# -# [STDIN] PROPVAL ** the old property value is passed via STDIN. -# -# Because the propchange has already completed and cannot be undone, -# the exit code of the hook program is ignored. The hook program -# can use the 'svnlook' utility to help it examine the -# new property value. -# -# On a Unix system, the normal procedure is to have 'post-revprop-change' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'post-revprop-change' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'post-revprop-change.bat' or 'post-revprop-change.exe', -# but the basic idea is the same. -# -# The hook program typically does not inherit the environment of -# its parent process. For example, a common problem is for the -# PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# /usr/share/subversion/hook-scripts, and in the repository at -# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and -# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ - - -REPOS="$1" -REV="$2" -USER="$3" -PROPNAME="$4" -ACTION="$5" - -"$REPOS"/hooks/mailer.py propchange2 "$REPOS" $REV \ - "$USER" "$PROPNAME" "$ACTION" "$REPOS"/hooks/mailer.conf diff --git a/test/data/IDF_Scm_SvnTest/testrepository/hooks/post-unlock.tmpl b/test/data/IDF_Scm_SvnTest/testrepository/hooks/post-unlock.tmpl deleted file mode 100644 index 277569f..0000000 --- a/test/data/IDF_Scm_SvnTest/testrepository/hooks/post-unlock.tmpl +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -# POST-UNLOCK HOOK -# -# The post-unlock hook runs after a path is unlocked. Subversion runs -# this hook by invoking a program (script, executable, binary, etc.) -# named 'post-unlock' (for which this file is a template) with the -# following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] USER (the user who destroyed the lock) -# -# The paths that were just unlocked are passed to the hook via STDIN -# (as of Subversion 1.2, only one path is passed per invocation, but -# the plan is to pass all unlocked paths at once, so the hook program -# should be written accordingly). -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# Because the lock has already been destroyed and cannot be undone, -# the exit code of the hook program is ignored. -# -# On a Unix system, the normal procedure is to have 'post-unlock' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'post-unlock' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'post-unlock.bat' or 'post-unlock.exe', -# but the basic idea is the same. -# -# Here is an example hook script, for a Unix /bin/sh interpreter: - -REPOS="$1" -USER="$2" - -# Send email to interested parties, let them know a lock was removed: -"$REPOS"/hooks/mailer.py unlock \ - "$REPOS" "$USER" "$REPOS"/hooks/mailer.conf diff --git a/test/data/IDF_Scm_SvnTest/testrepository/hooks/pre-commit.tmpl b/test/data/IDF_Scm_SvnTest/testrepository/hooks/pre-commit.tmpl deleted file mode 100644 index 44c24b9..0000000 --- a/test/data/IDF_Scm_SvnTest/testrepository/hooks/pre-commit.tmpl +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/sh - -# PRE-COMMIT HOOK -# -# The pre-commit hook is invoked before a Subversion txn is -# committed. Subversion runs this hook by invoking a program -# (script, executable, binary, etc.) named 'pre-commit' (for which -# this file is a template), with the following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] TXN-NAME (the name of the txn about to be committed) -# -# [STDIN] LOCK-TOKENS ** the lock tokens are passed via STDIN. -# -# If STDIN contains the line "LOCK-TOKENS:\n" (the "\n" denotes a -# single newline), the lines following it are the lock tokens for -# this commit. The end of the list is marked by a line containing -# only a newline character. -# -# Each lock token line consists of a URI-escaped path, followed -# by the separator character '|', followed by the lock token string, -# followed by a newline. -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# If the hook program exits with success, the txn is committed; but -# if it exits with failure (non-zero), the txn is aborted, no commit -# takes place, and STDERR is returned to the client. The hook -# program can use the 'svnlook' utility to help it examine the txn. -# -# On a Unix system, the normal procedure is to have 'pre-commit' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# *** NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT *** -# *** FOR REVISION PROPERTIES (like svn:log or svn:author). *** -# -# This is why we recommend using the read-only 'svnlook' utility. -# In the future, Subversion may enforce the rule that pre-commit -# hooks should not modify the versioned data in txns, or else come -# up with a mechanism to make it safe to do so (by informing the -# committing client of the changes). However, right now neither -# mechanism is implemented, so hook writers just have to be careful. -# -# Note that 'pre-commit' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'pre-commit.bat' or 'pre-commit.exe', -# but the basic idea is the same. -# -# The hook program typically does not inherit the environment of -# its parent process. For example, a common problem is for the -# PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# /usr/share/subversion/hook-scripts, and in the repository at -# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and -# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ - - -REPOS="$1" -TXN="$2" - -# Make sure that the log message contains some text. -SVNLOOK=/usr/bin/svnlook -$SVNLOOK log -t "$TXN" "$REPOS" | \ - grep "[a-zA-Z0-9]" > /dev/null || exit 1 - -# Exit on all errors. -set -e - -# Check that the author of this commit has the rights to perform -# the commit on the files and directories being modified. -"$REPOS"/hooks/commit-access-control.pl "$REPOS" $TXN \ - "$REPOS"/hooks/commit-access-control.cfg - -# All checks passed, so allow the commit. -exit 0 diff --git a/test/data/IDF_Scm_SvnTest/testrepository/hooks/pre-lock.tmpl b/test/data/IDF_Scm_SvnTest/testrepository/hooks/pre-lock.tmpl deleted file mode 100644 index 13827fb..0000000 --- a/test/data/IDF_Scm_SvnTest/testrepository/hooks/pre-lock.tmpl +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh - -# PRE-LOCK HOOK -# -# The pre-lock hook is invoked before an exclusive lock is -# created. Subversion runs this hook by invoking a program -# (script, executable, binary, etc.) named 'pre-lock' (for which -# this file is a template), with the following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] PATH (the path in the repository about to be locked) -# [3] USER (the user creating the lock) -# [4] COMMENT (the comment of the lock) -# [5] STEAL-LOCK (1 if the user is trying to steal the lock, else 0) -# -# If the hook program outputs anything on stdout, the output string will -# be used as the lock token for this lock operation. If you choose to use -# this feature, you must guarantee the tokens generated are unique across -# the repository each time. -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# If the hook program exits with success, the lock is created; but -# if it exits with failure (non-zero), the lock action is aborted -# and STDERR is returned to the client. - -# On a Unix system, the normal procedure is to have 'pre-lock' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'pre-lock' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'pre-lock.bat' or 'pre-lock.exe', -# but the basic idea is the same. -# -# Here is an example hook script, for a Unix /bin/sh interpreter: - -REPOS="$1" -PATH="$2" -USER="$3" - -# If a lock exists and is owned by a different person, don't allow it -# to be stolen (e.g., with 'svn lock --force ...'). - -# (Maybe this script could send email to the lock owner?) -SVNLOOK=/usr/bin/svnlook -GREP=/bin/grep -SED=/bin/sed - -LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \ - $GREP '^Owner: ' | $SED 's/Owner: //'` - -# If we get no result from svnlook, there's no lock, allow the lock to -# happen: -if [ "$LOCK_OWNER" = "" ]; then - exit 0 -fi - -# If the person locking matches the lock's owner, allow the lock to -# happen: -if [ "$LOCK_OWNER" = "$USER" ]; then - exit 0 -fi - -# Otherwise, we've got an owner mismatch, so return failure: -echo "Error: $PATH already locked by ${LOCK_OWNER}." 1>&2 -exit 1 diff --git a/test/data/IDF_Scm_SvnTest/testrepository/hooks/pre-revprop-change.tmpl b/test/data/IDF_Scm_SvnTest/testrepository/hooks/pre-revprop-change.tmpl deleted file mode 100644 index 576fb36..0000000 --- a/test/data/IDF_Scm_SvnTest/testrepository/hooks/pre-revprop-change.tmpl +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -# PRE-REVPROP-CHANGE HOOK -# -# The pre-revprop-change hook is invoked before a revision property -# is added, modified or deleted. Subversion runs this hook by invoking -# a program (script, executable, binary, etc.) named 'pre-revprop-change' -# (for which this file is a template), with the following ordered -# arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] REVISION (the revision being tweaked) -# [3] USER (the username of the person tweaking the property) -# [4] PROPNAME (the property being set on the revision) -# [5] ACTION (the property is being 'A'dded, 'M'odified, or 'D'eleted) -# -# [STDIN] PROPVAL ** the new property value is passed via STDIN. -# -# If the hook program exits with success, the propchange happens; but -# if it exits with failure (non-zero), the propchange doesn't happen. -# The hook program can use the 'svnlook' utility to examine the -# existing value of the revision property. -# -# WARNING: unlike other hooks, this hook MUST exist for revision -# properties to be changed. If the hook does not exist, Subversion -# will behave as if the hook were present, but failed. The reason -# for this is that revision properties are UNVERSIONED, meaning that -# a successful propchange is destructive; the old value is gone -# forever. We recommend the hook back up the old value somewhere. -# -# On a Unix system, the normal procedure is to have 'pre-revprop-change' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'pre-revprop-change' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'pre-revprop-change.bat' or 'pre-revprop-change.exe', -# but the basic idea is the same. -# -# The hook program typically does not inherit the environment of -# its parent process. For example, a common problem is for the -# PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# /usr/share/subversion/hook-scripts, and in the repository at -# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and -# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ - - -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 diff --git a/test/data/IDF_Scm_SvnTest/testrepository/hooks/pre-unlock.tmpl b/test/data/IDF_Scm_SvnTest/testrepository/hooks/pre-unlock.tmpl deleted file mode 100644 index d1aa858..0000000 --- a/test/data/IDF_Scm_SvnTest/testrepository/hooks/pre-unlock.tmpl +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh - -# PRE-UNLOCK HOOK -# -# The pre-unlock hook is invoked before an exclusive lock is -# destroyed. Subversion runs this hook by invoking a program -# (script, executable, binary, etc.) named 'pre-unlock' (for which -# this file is a template), with the following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] PATH (the path in the repository about to be unlocked) -# [3] USER (the user destroying the lock) -# [4] TOKEN (the lock token to be destroyed) -# [5] BREAK-UNLOCK (1 if the user is breaking the lock, else 0) -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# If the hook program exits with success, the lock is destroyed; but -# if it exits with failure (non-zero), the unlock action is aborted -# and STDERR is returned to the client. - -# On a Unix system, the normal procedure is to have 'pre-unlock' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'pre-unlock' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'pre-unlock.bat' or 'pre-unlock.exe', -# but the basic idea is the same. -# -# Here is an example hook script, for a Unix /bin/sh interpreter: - -REPOS="$1" -PATH="$2" -USER="$3" - -# If a lock is owned by a different person, don't allow it be broken. -# (Maybe this script could send email to the lock owner?) - -SVNLOOK=/usr/bin/svnlook -GREP=/bin/grep -SED=/bin/sed - -LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \ - $GREP '^Owner: ' | $SED 's/Owner: //'` - -# If we get no result from svnlook, there's no lock, return success: -if [ "$LOCK_OWNER" = "" ]; then - exit 0 -fi - -# If the person unlocking matches the lock's owner, return success: -if [ "$LOCK_OWNER" = "$USER" ]; then - exit 0 -fi - -# Otherwise, we've got an owner mismatch, so return failure: -echo "Error: $PATH locked by ${LOCK_OWNER}." 1>&2 -exit 1 diff --git a/test/data/IDF_Scm_SvnTest/testrepository/hooks/start-commit.tmpl b/test/data/IDF_Scm_SvnTest/testrepository/hooks/start-commit.tmpl deleted file mode 100644 index c10868f..0000000 --- a/test/data/IDF_Scm_SvnTest/testrepository/hooks/start-commit.tmpl +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -# START-COMMIT HOOK -# -# The start-commit hook is invoked before a Subversion txn is created -# in the process of doing a commit. Subversion runs this hook -# by invoking a program (script, executable, binary, etc.) named -# 'start-commit' (for which this file is a template) -# with the following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] USER (the authenticated user attempting to commit) -# [3] CAPABILITIES (a colon-separated list of capabilities reported -# by the client; see note below) -# -# Note: The CAPABILITIES parameter is new in Subversion 1.5, and 1.5 -# clients will typically report at least the "mergeinfo" capability. -# If there are other capabilities, then the list is colon-separated, -# e.g.: "mergeinfo:some-other-capability" (the order is undefined). -# -# The list is self-reported by the client. Therefore, you should not -# make security assumptions based on the capabilities list, nor should -# you assume that clients reliably report every capability they have. -# -# The working directory for this hook program's invocation is undefined, -# so the program should set one explicitly if it cares. -# -# If the hook program exits with success, the commit continues; but -# if it exits with failure (non-zero), the commit is stopped before -# a Subversion txn is created, and STDERR is returned to the client. -# -# On a Unix system, the normal procedure is to have 'start-commit' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'start-commit' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'start-commit.bat' or 'start-commit.exe', -# but the basic idea is the same. -# -# The hook program typically does not inherit the environment of -# its parent process. For example, a common problem is for the -# PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# /usr/share/subversion/hook-scripts, and in the repository at -# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and -# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ - - -REPOS="$1" -USER="$2" - -# Exit on all errors. -set -e - -"$REPOS"/hooks/commit-allower.pl --repository "$REPOS" --user "$USER" -"$REPOS"/hooks/special-auth-check.py --user "$USER" --auth-level 3 - -# All checks passed, so allow the commit. -exit 0