Skip to content

Commit 10a9911

Browse files
committed
Merged [4805] from rjsparks@nostrum.com:
When abandoning a chartering effort, only revert to approved charters if there's a chance one is there. Fixes bug ietf-tools#868 - Legacy-Id: 4933 Note: SVN reference [4805] has been migrated to Git commit 51426f1
2 parents 53b35ac + 51426f1 commit 10a9911

1 file changed

Lines changed: 29 additions & 9 deletions

File tree

test/mergedevbranch

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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##*/}
107111
branch=$1
108112
rev=$2
109113
fix=$3
114+
repo=$(echo -n "$(svn info | grep "^Repository Root: " | sed 's/Repository Root: //')")
110115

111116
note "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
118123
else
119124
die "Could not find a branch matching '$branch'"
120125
fi
121126
note "Merging from $branch@$rev"
122127

123128
note "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)
125130
set $(echo "$info" | tail -n +2 | head -n 1 | tr "|" "\t")
126131
who=$2; echo -e "\n$who"
127132
comment=$(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
131137
note "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
134154
mail -s "Merged datatracker branch personal/$branch@$rev to trunk" $who -c henrik@levkowetz.com <<-EOF
135155
Hi,
@@ -144,15 +164,15 @@ Regards,
144164
(via the mergesprintbranch script)
145165
EOF
146166
167+
147168
if [ "$ARG_COMMIT" ]; then
148169
echo "Committing the merge:"
149170
echo ""
150171
svn commit -m "Merged [$rev] from $who: $comment $fix"
151172
else
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
157175
fi
158176
177+
178+

0 commit comments

Comments
 (0)