Just contributing a version of the recipe script that's a bit more flexible.

-- 
C. Michael Pilato <cmpil...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand
#!/bin/sh -xe
# -------------------------------------------------------
SVN=svn
SVNADMIN=svnadmin
SVNRDUMP=svnrdump
REPO_DIR1=svnrdump-issue-repo-1
REPO_DIR2=svnrdump-issue-repo-2
WORK=svnrdump-issue-wc
# -------------------------------------------------------


${SVN} --version
${SVNRDUMP} --version

rm -rf ${REPO_DIR1} ${REPO_DIR2} ${WORK}

${SVNADMIN} create ${REPO_DIR1}
${SVNADMIN} create ${REPO_DIR2}

CURDIR=`pwd`
cd ${REPO_DIR1} && REPO1=`pwd` && cd ${CURDIR}
cd ${REPO_DIR2} && REPO2=`pwd` && cd ${CURDIR}

REPO1=file://${REPO1}
REPO2=file://${REPO2}

${SVN} mkdir -m 'setup dross' \
       --parents ${REPO1}/trunk/unrelated_project
svn co ${REPO1}/trunk/unrelated_project ${WORK}
cat > ${WORK}/sample1 <<EOF
sample1
EOF
cat > ${WORK}/sample2 <<EOF
sample2
EOF
${SVN} add ${WORK}/sample1
${SVN} commit -m 'setup dross file' ${WORK}/sample1
${SVN} add ${WORK}/sample2
${SVN} commit -m 'setup dross file' ${WORK}/sample2
${SVN} mkdir -m 'setup real work' \
       --parents ${REPO1}/trunk/real_project
# record starting rev for what we do want
REV=$(svn info $REPO1 | awk '/Revision:/ { print $2 }')
rm -rf ${WORK}

${SVN} co ${REPO1}/trunk/real_project ${WORK}
cat > ${WORK}/sample1 <<EOF
sample1
EOF
cat > ${WORK}/sample2 <<EOF
sample2
EOF
${SVN} add ${WORK}/sample1
${SVN} commit -m 'setup real file' ${WORK}/sample1
${SVN} add ${WORK}/sample2
${SVN} commit -m 'setup real file' ${WORK}/sample2
${SVN} mv ${WORK}/sample1 ${WORK}/sample3
${SVN} commit -m 'perform a rename' ${WORK}

HEAD=$(svn info ${REPO1} | awk '/Revision:/ { print $2 }')
# try crossloading
${SVN} mkdir -m 'need something to load trunk/real_project into' \
       $REPO2/trunk
# need to pump the version number up, or we lose on *every* rev?
for i in $(seq 1 10); do
    ${SVN} mkdir -m 'dummy' ${REPO2}/trunk/p${i}
done

ln -s /bin/true ${REPO_DIR2}/hooks/pre-revprop-change
# 3:HEAD gives, falsely, "svnrdump: E205000: Unsupported revision
# specifier used; use only integer values or 'HEAD'"
echo ${REV} = 4, ${HEAD} = 7
${SVNRDUMP} dump --incremental \
            -r ${REV}:${HEAD} ${REPO1} | ${SVNRDUMP} load ${REPO2}

Reply via email to