All pastes #99755 Raw Edit

svn copy bug script

public text v1 · immutable
#99755 ·published 2006-07-25 16:30 UTC
rendered paste body
#!/bin/sh

#script to replicate subversion bug: copy (tag) a directory when the
#target already exists gives a poor error message.  Error message when
#copying from a URL is better (issue 2214).

rm -rf repos
rm -rf wc

SVNADMIN=svnadmin
SVN=svn
REPOS_URL=file://`pwd`/repos

${SVNADMIN} create repos
${SVN} mkdir -q -m "Create trunk dir." "${REPOS_URL}/trunk"
${SVN} mkdir -q -m "Create tags dir." "${REPOS_URL}/tags"

${SVN} co -q "${REPOS_URL}/trunk" wc
cd wc
${SVN} cp -q -m "Tag trunk from wc." \
       . "${REPOS_URL}/tags/t-1"
#seems like maybe this one should fail ... ?
${SVN} cp -q -m "Tag trunk from wc again." \
       . "${REPOS_URL}/tags/t-1"
#but actually this one does
${SVN} cp -q -m "Tag trunk from wc third time." \
       . "${REPOS_URL}/tags/t-1"
cd ..