@@ -101,35 +101,55 @@ done
101101# ----------------------------------------------------------------------
102102# The program itself
103103
104+ # Argument validation
104105[[ $1 =~ @ ]] && set ${1/@/ }
105106[ $# -ge 2 ] || die " Expected branch and repository revision on the command line"
106107[ ${PWD##*/ } = trunk ] || die " Expected this script to be run in trunk"
108+
109+ # Global settings
110+ cwd=${PWD##*/ }
107111branch=$1
108112rev=$2
109113fix=$3
114+ repo=$( echo -n " $( svn info | grep " ^Repository Root: " | sed ' s/Repository Root: //' ) " )
110115
111116note " Identify the branch:"
112- if svn info http://svn.tools.ietf.org/svn/tools/ietfdb /personal/$branch > /dev/null 2>&1 ; then
117+ if svn info ${repo} /personal/$branch > /dev/null 2>&1 ; then
113118 branch=" personal/$branch "
114- elif svn info http://svn.tools.ietf.org/svn/tools/ietfdb /branch/$branch > /dev/null 2>&1 ; then
119+ elif svn info ${repo} /branch/$branch > /dev/null 2>&1 ; then
115120 branch=" branch/$branch "
116- elif svn info http://svn.tools.ietf.org/svn/tools/ietfdb /$branch > /dev/null 2>&1 ; then
121+ elif svn info ${repo} /$branch > /dev/null 2>&1 ; then
117122 true
118123else
119124 die " Could not find a branch matching '$branch '"
120125fi
121126note " Merging from $branch @$rev "
122127
123128note " Extract who and what:"
124- info=$( svn log http://svn.tools.ietf.org/svn/tools/ietfdb / -r $rev --incremental)
129+ info=$( svn log ${repo} / -r $rev --incremental)
125130set $( echo " $info " | tail -n +2 | head -n 1 | tr " |" " \t" )
126131who=$2 ; echo -e " \n$who "
127132comment=$( echo " $info " | tail -n +3) ; echo -e " $comment \n"
133+ files=$( svn diff ${repo} / -c $rev --summarize | awk ' {$1=""; print;}' | while read file; do echo " ${file/ $repo \/ $branch \/ / } " ; done)
128134
129-
135+ echo -n " Files: \n $files "
130136
131137note " Do the merge:"
132- svn merge -c $rev http://svn.tools.ietf.org/svn/tools/ietfdb/$branch .
138+ svn merge -c $rev ${repo} /$branch . || die " Merge of $branch @$rev failed"
139+
140+ C=$( svn st | cut -c 1-7 | grep -oh ' C' | head -n 1)
141+ G=$( svn st | cut -c 1-7 | grep -oh ' G' | head -n 1)
142+
143+ date +" %Y-%m-%d %H:%M:%S $C$G @$rev $branch " >> $progdir /../mergelog
144+
145+ cd ../
146+ rsync -av $cwd / $cwd @$rev /
147+ cd $cwd @$rev /
148+
149+ echo -e " #!/bin/bash\n\nsvn commit -m \" Merged [$rev ] from $who : ${comment/ \" / \' } ${fix/ \" / \' } \" " > commit
150+ chmod +x commit
151+
152+ PYTHONPATH=$PWD ietf/manage.py test || die " Testing of $branch @$rev merged to trunk failed -- not sending email, not committing."
133153
134154mail -s " Merged datatracker branch personal/$branch @$rev to trunk" $who -c henrik@levkowetz.com << -EOF
135155Hi,
@@ -144,15 +164,15 @@ Regards,
144164 (via the mergesprintbranch script)
145165EOF
146166
167+
147168if [ " $ARG_COMMIT " ]; then
148169 echo " Committing the merge:"
149170 echo " "
150171 svn commit -m " Merged [$rev ] from $who : $comment $fix "
151172else
152173 echo " This merge has not been committed yet."
153174 echo " To commit it, run this commit command: ../commit-$rev -merge.sh"
154- echo " "
155- echo -e " #!/bin/bash\n\nsvn commit -m \" Merged [$rev ] from $who : ${comment/ \" / \' } ${fix/ \" / \' } \" " > ../commit-$rev -merge.sh
156- chmod +x ../commit-$rev -merge.sh
157175fi
158176
177+
178+
0 commit comments