5 printf "\nMerge remote url commits into local BeRTOS svn repository.\n"
6 printf "Usage: $0 <REMOTE_URL> <REMOTE_START_REV> [<REMOTE_END_REV>]\n"
7 printf "If remote end revision is not supplied HEAD will be used.\n"
14 if [ z"$3" = z ] ; then
20 #Check for local uncommitted modifications
21 STATUS=`svn status -q`
22 if [[ z"$STATUS" != z && "${STATUS:0:1}" != $'\n' ]] ; then
23 printf "Project has local modifications, it must be clean\n"
27 #Get list of revisions to merge.
28 REV_LIST=`svn log $MERGE_URL -r$START_REV:$END_REV --quiet 2>&1| perl -ne 'if(m/^r([0-9]+)/) {print $1, "\n";}'`
30 printf "Merged from external project:\n" > header
33 #Get commit log message only
34 #svn pg --revprop -r$rev svn:log $MERGE_URL > tmp_msg
36 #Get revision commit log with date and author
37 svn log -r$rev $MERGE_URL > tmp_msg
38 #Replace leading and trailing banners "---------------------..."
39 sed -i 's/^-\+/\*\*\*\*\*\*\*\*\*\*/' tmp_msg
41 sed -i 's/\(^.*\)/\t\1/' tmp_msg
42 cat header tmp_msg > commit_msg
44 svn merge $MERGE_URL -c$rev || exit 1
48 rm -rf header tmp_msg commit_msg