@@ -68,10 +68,11 @@ trap 'echo "$program($LINENO): Command failed with error code $? ([$$] $0 $*)";
6868# Option parsing
6969
7070# Options
71- shortopts=chvV
72- longopts=commit,help,verbose,version
71+ shortopts=cnhvV
72+ longopts=commit,no-commit, help,verbose,version
7373
7474# Default values
75+ ARG_COMMIT=1
7576
7677if [ " $( uname) " = " Linux" ]; then
7778 args=$( getopt -o " $shortopts " --long " $longopts " -n ' $program' -- $SV " $@ " )
8990while true ; do
9091 case " $1 " in
9192 -c| --commit) ARG_COMMIT=1;; # Run commit in addition to merge
93+ -n| --no-commit) ARG_COMMIT=0;; # Don't commit after merge
9294 -h| --help) usage; exit ;; # Show this help, then exit
9395 -v| --verbose) VERBOSE=1;; # Be more talkative
9496 -V| --version) version; exit ;; # Show program version, then exit
@@ -133,13 +135,20 @@ info=$(svn log ${repo}/ -r $rev --incremental)
133135set $( echo " $info " | tail -n +2 | head -n 1 | tr " |" " \t" )
134136who=$2 ; echo -e " \n$who "
135137comment=$( echo " $info " | tail -n +3) ; echo -e " $comment \n"
138+ comment=$( echo " $comment " | sed -r -e ' s/(commit )?ready (for|to) merge\.?//i' -e ' /^$/d' )
136139files=$( svn diff ${repo} / -c $rev --summarize | awk ' {$1=""; print;}' | while read file; do echo " ${file/ $repo \/ $branch \/ / } " ; done)
137140
138- echo -e " Files: \n$files "
141+ echo -e " Files: \n$files \n "
139142
140- note " Writing commit script"
141- echo -e " #!/bin/bash\n\nsvn commit -m \" Merged [$rev ] from $who : ${comment/ \" / \' } ${fix/ \" / \' } \" " > ../cicmd/commit-${rev} -merge.sh
142- chmod +x ../cicmd/commit-${rev} -merge.sh
143+ read -p " Continue with diff? [Y/n] "
144+ [ " $REPLY " = " Y" -o " $REPLY " = " y" -o " $REPLY " = " " ] || exit
145+
146+ note " Diff:"
147+ svn diff -c $rev $repo /$branch | less
148+
149+ echo " "
150+ read -p " Continue with the merge? [Y/n] "
151+ [ " $REPLY " = " Y" -o " $REPLY " = " y" -o " $REPLY " = " " ] || exit
143152
144153note " Do the merge:"
145154if [[ $rev =~ : ]]; then
@@ -150,14 +159,14 @@ else
150159 svn merge -c $rev ${repo} /$branch ."
151160fi
152161
162+ note " Writing commit script"
163+ echo -e " #!/bin/bash\n\nsvn commit -m \" Merged [$rev ] from $who : ${comment/ \" / \' } ${fix/ \" / \' } \" " > ../cicmd/commit-${rev} -merge.sh
164+ chmod +x ../cicmd/commit-${rev} -merge.sh
165+
153166M=$( svn st | cut -c 1-7 | grep -oh ' M' | head -n 1)
154167C=$( svn st | cut -c 1-7 | grep -oh ' C' | head -n 1)
155168G=$( svn st | cut -c 1-7 | grep -oh ' G' | head -n 1)
156169
157-
158- date +" %Y-%m-%d %H:%M:%S $G$C$M @$rev $branch " >> mergelog
159- date +" %Y-%m-%d %H:%M:%S Merged $branch @$rev " >> testresult
160-
161170cd ../
162171rsync -a $cwd / merged@$rev /
163172cp cicmd/commit-${rev} -merge.sh merged@$rev /commit
@@ -178,8 +187,13 @@ Regards,
178187 (via the mergesprintbranch script)
179188EOF
180189
190+ svn revert ietf/meeting
191+
192+
193+ echo -e " \nRunning tests"
194+ ietf/manage.py test --settings=settings_sqlitetest || die " Tests failed"
181195
182- if [ " $ARG_COMMIT " ]; then
196+ if [ " $ARG_COMMIT " != 0 ]; then
183197 echo " Committing the merge:"
184198 echo " "
185199 svn commit -m " Merged [$rev ] from $who : $comment $fix "
0 commit comments