我做了一个bash脚本来合并两个不同的分支(使用相同的前一个树),由于某种原因,我仍然缺少mergeinfo。是否有任何参数要传递给svn CLI才能包含此选项?
这是我的剧本:
#!/bin/bash
source=$1
target=$2
inputFile=$3
if [ "$#" -ne 3 ]; then
echo "you need to pass 3 parameter!"
echo "usage: $0 source target inputFile"
exit 1
fi
cd $target
while IFS= read -r line
do
IFS=' ' read -r id string <<< "$line"
echo "Revision $id, message $string"
svn update
svn merge -c $id $source
if [ -z "$(svn status | grep -P '^(?=.{0,6}C)')" ]; then
echo "No conflicts, proceeding to commit revision $id"
svn commit * -m "Merge revision $id from $source: $string"
else
echo "Conflicts, terminating the merge with id $id"
svn revert *
exit 1
fi
done < "$inputFile"