diff options
Diffstat (limited to 'git/git-svn-mirror-finish')
-rwxr-xr-x | git/git-svn-mirror-finish | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/git/git-svn-mirror-finish b/git/git-svn-mirror-finish index 41f5ba9..04d2a4b 100755 --- a/git/git-svn-mirror-finish +++ b/git/git-svn-mirror-finish @@ -14,9 +14,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +SVNROOT=file:///svnroot GITROOT=/gitroot HEADPFX= +set -e + if [ -r /etc/mirror/git/config ]; then . /etc/mirror/git/config fi @@ -50,7 +53,7 @@ if [ $# -ne 1 ]; then exit 1 fi -cd $GITROOT/$1 || exit 1 +cd $GITROOT/$1 git branch -r | while read tag @@ -77,3 +80,33 @@ if [ -x .git/hooks/pre-receive ]; then echo "Keeping old pre-receive hook in $GITROOT/$1/.git/hooks/pre-receive.mirror" mv .git/hooks/pre-receive .git/hooks/pre-receive.mirror fi + +if test -n "$SVNREADME" -a -r "$SVNREADME"; then + readme=$(basename "$SVNREADME") + cd /tmp + CONAME=$1.$$ + svn co -q $SVNROOT/$1/trunk $CONAME + cd $CONAME + if test "$SVNREMOVE" = "yes"; then + echo "Removing SVN trunk" + svn remove --force --non-interactive * + fi + echo "Installing the $readme file" + if test -x "$SVNREADME"; then + $SVNREADME $1 > "$readme" + else + cp "$SVNREADME" "$readme" + fi + svn add "$readme" + svn commit --non-interactive -m "Add $readme (by $0)" + cd /tmp + rm -rf "$CONAME" +fi + +if test -n "$SVNHOOK" -a -r "$SVNHOOK"; then + echo "Installing SVN pre-commit hook" + dir=${SVNROOT##file://}/$1/hooks + cp $SVNHOOK $dir/pre-commit + chmod +x $dir/pre-commit +fi + |