]>
Tony Duckles's Git Repositories (git.nynim.org) - svn2svn.git/blob - tests/make-replay-repo.sh
2 # Use svn2svn.py to create a filtered repo with only /trunk history
5 REPO
="$PWD/_repo_replay"
13 echo "Creating _repo_replay..."
15 # Add pre-revprop-change hook script, which is required by svn2svn
16 cat > $REPO/hooks
/pre
-revprop-change << EOF
19 # PRE-REVPROP-CHANGE HOOK
21 # The pre-revprop-change hook is invoked before a revision property
22 # is added, modified or deleted. Subversion runs this hook by invoking
23 # a program (script, executable, binary, etc.) named 'pre-revprop-change'
24 # (for which this file is a template), with the following ordered
27 # [1] REPOS-PATH (the path to this repository)
28 # [2] REVISION (the revision being tweaked)
29 # [3] USER (the username of the person tweaking the property)
30 # [4] PROPNAME (the property being set on the revision)
31 # [5] ACTION (the property is being 'A'dded, 'M'odified, or 'D'eleted)
33 # [STDIN] PROPVAL ** the new property value is passed via STDIN.
35 # If the hook program exits with success, the propchange happens; but
36 # if it exits with failure (non-zero), the propchange doesn't happen.
37 # The hook program can use the 'svnlook' utility to examine the
38 # existing value of the revision property.
40 # WARNING: unlike other hooks, this hook MUST exist for revision
41 # properties to be changed. If the hook does not exist, Subversion
42 # will behave as if the hook were present, but failed. The reason
43 # for this is that revision properties are UNVERSIONED, meaning that
44 # a successful propchange is destructive; the old value is gone
45 # forever. We recommend the hook back up the old value somewhere.
47 # On a Unix system, the normal procedure is to have 'pre-revprop-change'
48 # invoke other programs to do the real work, though it may do the
51 # Note that 'pre-revprop-change' must be executable by the user(s) who will
52 # invoke it (typically the user httpd runs as), and that user must
53 # have filesystem-level permission to access the repository.
55 # On a Windows system, you should name the hook program
56 # 'pre-revprop-change.bat' or 'pre-revprop-change.exe',
57 # but the basic idea is the same.
59 # The hook program typically does not inherit the environment of
60 # its parent process. For example, a common problem is for the
61 # PATH environment variable to not be set to its usual value, so
62 # that subprograms fail to launch unless invoked via absolute path.
63 # If you're having unexpected problems with a hook program, the
64 # culprit may be unusual (or missing) environment variables.
66 # Here is an example hook script, for a Unix /bin/sh interpreter.
67 # For more examples and pre-written hooks, see those in
68 # the Subversion repository at
69 # http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and
70 # http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/
78 echo "pre-revprop-change: REPOS=\$1 REV=\$2 USER=\$3 PROPNAME=\$4 ACTION=\$5" >&2
80 if [ "\$ACTION" = "M" -a "\$PROPNAME" = "svn:log" ]; then exit 0; fi
81 if [ "\$ACTION" = "A" -a "\$PROPNAME" = "svn2svn:source_uuid" ]; then exit 0; fi
82 if [ "\$ACTION" = "M" -a "\$PROPNAME" = "svn2svn:source_uuid" ]; then exit 0; fi
83 if [ "\$ACTION" = "A" -a "\$PROPNAME" = "svn2svn:source_url" ]; then exit 0; fi
84 if [ "\$ACTION" = "M" -a "\$PROPNAME" = "svn2svn:source_url" ]; then exit 0; fi
85 if [ "\$ACTION" = "A" -a "\$PROPNAME" = "svn2svn:source_rev" ]; then exit 0; fi
86 if [ "\$ACTION" = "M" -a "\$PROPNAME" = "svn2svn:source_rev" ]; then exit 0; fi
88 echo "Changing revision property \$PROPNAME is prohibited" >&2
91 chmod 755 $REPO/hooks
/pre
-revprop-change
92 svn
mkdir -q -m "Add /trunk" $REPOURL/trunk
95 ..
/svn2svn.py
-a file://$PWD/_repo_ref
/trunk
file://$PWD/_repo_replay
/trunk