Question

I am trying to set the svn:externals property from a bash script. The line that fails is:

svn propset svn:externals \'WEB-INF/src/com/project https://subversion.assembla.com/svn/myProject/branches/Release_$Version/com/project\' .

Where $Version is a variable taken from a command line argument.

The trouble is, this line works fine from the prompt but doesn't work in a script. I tested this by echoing the line to the console, copying and pasting it to the command prompt and running. It works fine from the prompt but not from the script. When run from the script I get the following error:

svn: E200009: Cannot mix repository and working copy targets

I have searched the net for hours but cannot find any answers. I have a feeling that the problem may be to do with the escape characters used to escape the ' character but I am not sure how to fix it.

Was it helpful?

Solution

You can certainly try and find the right combination of quotes and backslashes, but why not use a temporary file instead? Something like:

cat > some_temp_file << EOF
WEB-INF/src/com/project https://subversion.assembla.com/svn/myProject/branches/Release_$Version/com/project
EOF
svn propset svn:externals --file some_temp_file
rm -f some_temp_file

Note that I haven't tested my snippet.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top