我的svn propset
命令在从提示符调用时有效,但在bash脚本中的while循环中调用时无法正常工作。
我的命令如下所示,
svn propset -r945 --revprop svn:log '[Release ] [story]' blahReport.sh
我的脚本在下面,
[[ ! -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
我已经在脚本上设置了一个-x,但它对我来说很好。
不确定遗失了什么......对于其他人来说,这可能是明显的明显,有什么建议吗?
答案 0 :(得分:0)
由于对mark a comment as an answer的功能请求仍然被拒绝,我在此处复制上述解决方案。
我终于通过在svn命令中提供用户名和密码作为参数来解决这个问题。 svn propset --username $ USER --password $ PASSWORD --revision“$ OLD_VERSION”--revprop svn:log“$ NEW_COMMENT”“$ svnlink”/“$ FILE” - BratVaddi