svn propset does not work when called from a script

619 views Asked by At

My svn propset command works when it is called from the prompt but does not work properly when called inside a while loop in a bash script.

my command looks like below,

svn propset -r945 --revprop svn:log '[Release ] [story]' blahReport.sh

and my script is below,

[[ ! -n $1 ]] && echo "Please enter the release number" && exit 1

[[ ! -e $AC_SYSTEM/releases/filesforrelease.$1.txt ]] && rm $AC_SYSTEM/releases/filesforrelease.$1.txt

cat $AC_SYSTEM/releases/release_$1.txt >> $AC_SYSTEM/releases/filesforrelease.$1.txt

sed "s/^/#/g" $AC_SYSTEM/releases/filesforrelease.$1.txt >> /tmp/filesforrelease.$1.txt

mv /tmp/filesforrelease.$1.txt $AC_SYSTEM/releases/filesforrelease.$1.txt

svnlink="http://sublime-ssi/blah/blah/trunk"

while read -r story

do

if [[ ! -e $story.file ]];

then

while read -r storyline

 do

        revNum=`echo $storyline | cut -d"|" -f1`

        fileName=`echo $storyline | cut -d"|" -f2`

        echo "$revNum ~ac/$fileName" >> $AC_SYSTEM/releases/filesforrelease.$1.txt

svn propset -r"$revNum" --revprop svn:log "[$1] [$story]" "$svnlink"/"$fileName"

        done<$AC_SYSTEM/stories/$story.file

else

echo "story file for $story does not exist..please check the story directory"

exit 1

fi

done</export/home/acdba/ac/releases/release_$1.txt

I've done a set -x on the script but it looks fine to me.

Not sure what am missing.. It might be something glaringly obvious to others, any suggestions?

1

There are 1 answers

0
Armali On

Since feature requests to mark a comment as an answer remain declined, I copy the above solution here.

I finally got this fixed by supplying username and password as parameters in the svn command. svn propset --username $USER --password $PASSWORD --revision "$OLD_VERSION" --revprop svn:log "$NEW_COMMENT" "$svnlink"/"$FILE" – BratVaddi