Discussions  >  CollabNet Subversion Admins  >  svn copy doesn't work through bash

Back to topic list

svn copy doesn't work through bash

Author tsgomez (OCN Member)
Full name Tyler Gomez
Date 2012-04-02 13:54:35 PDT
Message I'm a SVN Admin...but didn't know where to post this, so it's posted in both trhe Dev section and here. Please let me know where it belongs and I'll delete the other one...


I'm having problems getting svn copy to work from my bash script. What I'm trying to do is simplify branch creation by adding this function to my .basrc

__please note that the URL http://00.00.00.000 is a valid URL but has been redacted per company policy__

[CODE]
#Function to simplify branch creation

script_parameters="<Repo to create branch in> <branch to copy from> <Branch Name> <\"Comment\">"
  Number_of_expected_args=4
  if [ $# -ne $Number_of_expected_args ]; then
  echo "USAGE: mkbranch $script_parameters"
  
  else
  REPO=$1
  SOURCE=$2
  BRANCH_NAME=$3
  COMMENT=\"$4\"
  CMD="svn copy http://00.00.00.000:​​18080/svn/$REPO/br​a​nches/$SOURCE http://00.00.00.000:​​18080/svn/$REPO/br​a​nches/$BRANCH_NAM​E -m \"$COMMENT\""
  $CMD
fi
[/CODE]

When I run the command

svn copy http://00.00.00.000:​​18080/svn/$REPO/br​a​nches/$SOURCE http://00.00.00.000:​​18080/svn/$REPO/br​a​nches/$BRANCH_NAM​E -m \"$COMMENT\"

from the command line, it works as expected.

When I attempt to run this command through the script, I receive the error:
  svn: E205009: Local, non-commit operations do not take a log message or revision properties

I've tried to remove the -m $COMMENT from the script, but get these errors (which tell me the option -m is required):
  svn: E205007: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using the --message (-m) or --file (-F) options
  svn: E205007: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no 'editor-cmd' run-time configuration option was found



My question...why doesn't this command work from the script. Better yet, how can I get it to run from the script?

« Previous message in topic | 1 of 2 | Next message in topic »

Messages

Show all messages in topic

svn copy doesn't work through bash tsgomez (OCN Member) Tyler Gomez 2012-04-02 13:54:35 PDT
     RE: svn copy doesn reack_he (OCN Member) he anping 2013-08-22 23:17:11 PDT
Messages per page: