Skip to content

Instantly share code, notes, and snippets.

@jesperronn
Created November 27, 2009 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesperronn/244033 to your computer and use it in GitHub Desktop.
Save jesperronn/244033 to your computer and use it in GitHub Desktop.
#!/bin/sh
DEST=/svnroot/dk_es_virkdk
SRC_URL=https://cs-blade1.common.capgemini.dk:8443/svn/virk.dk
SRC_USER=jronn
SRC_PASS=abcd1234
DST_USER=svnsync
#svnsync initialize --source-username jronn --source-password abcd1234 file:///Users/jesper/src/v2 https://cs-blade1.common.capgemini.dk:8443/svn/virk.dk
rm -rf $DEST && svnadmin create $DEST
cat <<'EOF' > $DEST/hooks/pre-revprop-change
#!/bin/sh
USER="$3"
if [ "$USER" = "svnsync" ]; then exit 0; fi
echo "Only the svnsync user can change revprops" >&2
exit 1
EOF
chmod +x $DEST/hooks/pre-revprop-change
cd $DEST
D=`pwd -P`
svnsync initialize --source-username $SRC_USER --source-password $SRC_PASS \
--sync-username $DST_USER file://$D \
$SRC_URL
echo "done"
echo "Now run the following command"
echo
echo "svnsync sync file://$D"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment