Skip to content

Commit 2846665

Browse files
committed
Merge in sprint branch management commands from old trunk
- Legacy-Id: 4138
1 parent d086d8c commit 2846665

10 files changed

Lines changed: 550 additions & 0 deletions

File tree

test/mergedevbranch

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
#!/bin/bash
2+
3+
version=0.20
4+
program=${0##*/}
5+
progdir=${0%/*}
6+
if [ "$progdir" = "$program" ]; then progdir="."; fi
7+
8+
# ----------------------------------------------------------------------
9+
function usage() {
10+
cat <<EOF
11+
NAME
12+
$program - merge and commit a sprint branch
13+
14+
SYNOPSIS
15+
$program [OPTIONS] BRANCH SVNREV
16+
17+
DESCRIPTION
18+
Merge and commit a sprint branch
19+
20+
EOF
21+
echo -e "OPTIONS"
22+
if [ "$(uname)" = "Linux" ]; then
23+
egrep "^[ ]+[-][A-Za-z| -]+\*?\)[ ]+[A-Za-z].+#" $0 | tr -s "\t|" "\t," | sed -r -e 's/\)[ \t]+([A-Z]+)=\$2[^#]*#/=\1\t/' -e 's/\)[^#]*#/\t/'
24+
else
25+
egrep "^[ ]+[-][A-Za-z| -]+\*?\)[ ]+[A-Za-z].+#" $0 | sed 's/\|.*\$2[^#]*#/ /'| sed -E 's/\|.*\)[^#]*#/ /'
26+
fi
27+
cat <<EOF
28+
29+
FILES
30+
31+
AUTHOR
32+
Written by Henrik Levkowetz, <henrik@tools.ietf.org>
33+
34+
COPYRIGHT
35+
Copyright 2010 Henrik Levkowetz.
36+
37+
This program is free software; you can redistribute it and/or modify
38+
it under the terms of the GNU General Public License as published by
39+
the Free Software Foundation; either version 2 of the License, or (at
40+
your option) any later version. There is NO WARRANTY; not even the
41+
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
42+
PURPOSE. See the GNU General Public License for more details.
43+
44+
EOF
45+
46+
}
47+
48+
# ----------------------------------------------------------------------
49+
function die() {
50+
echo -e "\n$program: error: $*" > /dev/stderr
51+
exit 1
52+
}
53+
54+
function note() {
55+
if [ -n "$VERBOSE" ]; then echo -e "$*"; fi
56+
}
57+
58+
# ----------------------------------------------------------------------
59+
function version() {
60+
echo -e "$program $version"
61+
}
62+
63+
# ----------------------------------------------------------------------
64+
trap 'echo "$program($LINENO): Command failed with error code $? ([$$] $0 $*)"; exit 1' ERR
65+
66+
67+
# ----------------------------------------------------------------------
68+
# Option parsing
69+
70+
# Options
71+
shortopts=chvV
72+
longopts=commit,help,verbose,version
73+
74+
# Default values
75+
76+
if [ "$(uname)" = "Linux" ]; then
77+
args=$(getopt -o "$shortopts" --long "$longopts" -n '$program' -- $SV "$@")
78+
if [ $? != 0 ] ; then die "Terminating..." >&2 ; exit 1 ; fi
79+
eval set -- "$args"
80+
sed="sed -r"
81+
else
82+
# Darwin, BSDs
83+
args=$(getopt -o$shortopts $SV $*)
84+
if [ $? != 0 ] ; then die "Terminating..." >&2 ; exit 1 ; fi
85+
set -- $args
86+
sed="sed -E"
87+
fi
88+
89+
while true ; do
90+
case "$1" in
91+
-c| --commit) ARG_COMMIT=1;; # Run commit in addition to merge
92+
-h| --help) usage; exit;; # Show this help, then exit
93+
-v| --verbose) VERBOSE=1;; # Be more talkative
94+
-V| --version) version; exit;; # Show program version, then exit
95+
--) shift; break;;
96+
*) die "Internal error, inconsistent option specification: '$1'";;
97+
esac
98+
shift
99+
done
100+
101+
# ----------------------------------------------------------------------
102+
# The program itself
103+
104+
[[ $1 =~ @ ]] && set ${1/@/ }
105+
[ $# -ge 2 ] || die "Expected branch and repository revision on the command line"
106+
[ ${PWD##*/} = trunk ] || die "Expected this script to be run in trunk"
107+
branch=$1
108+
rev=$2
109+
fix=$3
110+
111+
note "Extract who and what:"
112+
info=$(svn log http://svn.tools.ietf.org/svn/tools/ietfdb/ -r $rev --incremental)
113+
set $(echo "$info" | tail -n +2 | head -n 1 | tr "|" "\t")
114+
who=$2; echo -e "\n$who"
115+
comment=$(echo "$info" | tail -n +3); echo -e "$comment\n"
116+
117+
note "Do the merge:"
118+
svn merge -c $rev http://svn.tools.ietf.org/svn/tools/ietfdb/personal/$branch .
119+
120+
mail -s "Merged datatracker branch personal/$branch@$rev to trunk" $who -c henrik@levkowetz.com <<-EOF
121+
Hi,
122+
123+
This is an automatic merge info message. Your code in personal/$branch@$rev
124+
has been merged to trunk, and will be part of the next release if nothing
125+
goes wrong during final testing.
126+
127+
Regards,
128+
129+
Henrik
130+
(via the mergesprintbranch script)
131+
EOF
132+
133+
if [ "$ARG_COMMIT" ]; then
134+
echo "Committing the merge:"
135+
echo ""
136+
svn commit -m "Merged [$rev] from $who: $comment $fix"
137+
else
138+
echo "This merge has not been committed yet."
139+
echo "To commit it, run this commit command:"
140+
echo ""
141+
echo "svn commit -m \"Merged [$rev] from $who: $comment $fix\""
142+
fi
143+

test/mkdevbranch

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/bin/bash
2+
3+
version=0.21
4+
program=${0##*/}
5+
progdir=${0%/*}
6+
if [ "$progdir" = "$program" ]; then progdir="."; fi
7+
8+
function die() {
9+
echo -e "\n$program: Error: ${1:0:160} ..." >&2
10+
exit 1
11+
}
12+
13+
function warn() {
14+
logger -i -p user.warn -t $program "$*"
15+
echo "$program: Warning: $*" 1>&2;
16+
}
17+
18+
function note() {
19+
logger -i -p user.notice -t $program "$*"
20+
if [ -n "$OPT_VERBOSE" ]; then echo -e "$*"; fi
21+
}
22+
23+
function version() {
24+
echo -e "$program: v$version\n\nRunning as $(id -urn) on $(date +'%Y-%m-%d %H:%M')"
25+
}
26+
27+
#[ "$#" -gt 0 ] || die "Expected the ietf number as argument on the command line, but found nothing"
28+
#[ $1 -gt 70 ] || die "Expected the ietf number as argument on the command line, but found '$1'"
29+
30+
#if [ "$1" ]; then arg=$1; else arg=$(svn info http://svn.tools.ietf.org/svn/tools/ietfdb/trunk/ | egrep "^Last Changed Rev" | awk '{print $4}'); fi
31+
if [ "$1" ]; then arg=$1; else arg=$(svn ls http://svn.tools.ietf.org/svn/tools/ietfdb/tags/ | tail -n 1 | sed -r 's/^(.*)\/$/v\1/' ); fi
32+
33+
if [ "${arg:0:1}" = "v" ]; then
34+
source="tags/${arg:1}"
35+
target="$arg"
36+
rev="release $arg"
37+
else
38+
source="trunk@$arg"
39+
target="r$arg"
40+
rev="repository rev r$arg"
41+
fi
42+
43+
function mksvndir() {
44+
who=$1
45+
if [ "$2" ]; then dir=$2; else dir=$who; fi
46+
if ! svn info http://svn.tools.ietf.org/svn/tools/ietfdb/personal/$dir >/dev/null 2>&1 ; then
47+
echo "Creating personal directory area for IETF datatracker coding: /personal/$dir"
48+
svn mkdir http://svn.tools.ietf.org/svn/tools/ietfdb/personal/$dir -m "Personal SVN dir for $who, for IETF datatracker code"
49+
else
50+
echo "Repository area personal/$dir is already in place."
51+
fi
52+
}
53+
54+
num=$( < /www/tools.ietf.org/meta/current-ietf-number.txt)
55+
trac-admin /www/tools.ietf.org/tools/ietfdb wiki export IETF${num}SprintSignUp \
56+
| egrep "^\|\|" | tail -n +2 | python -c '
57+
import sys, re
58+
for line in sys.stdin:
59+
blank, name, email, rest = line.strip().split("||", 3)
60+
login, dummy = re.split("[@.]", email, 1)
61+
print "\t".join((login.strip().lower(), email.strip().lower(), name.strip())) ' \
62+
| $progdir/update $progdir/sprint$num.txt
63+
64+
cat $(ls $progdir/sprint*.txt | tail -n 4) | sed 's/[ \t]*$//' | sort | uniq | while read login email name; do
65+
echo ""
66+
echo "$login ($name <$email>):"
67+
mksvndir $login
68+
if ! svn info http://svn.tools.ietf.org/svn/tools/ietfdb/personal/$login/$target >/dev/null 2>&1 ; then
69+
echo " creating $target branch for $login ($name)."
70+
svn cp http://svn.tools.ietf.org/svn/tools/ietfdb/$source http://svn.tools.ietf.org/svn/tools/ietfdb/personal/$login/$target/ -m "New IETF datatracker coding branch for $name" \
71+
&& mail "$name <$email>" -s "A new SVN branch for you for IETF datatracker coding${rev:+, based on $rev}." -b henrik@levkowetz.com <<-EOF
72+
Hi,
73+
74+
This mail has been automatically generated by the $program script.
75+
76+
A new SVN branch has been set up for you for IETF datatracker coding, at
77+
http://svn.tools.ietf.org/svn/tools/ietfdb/personal/$login/$target
78+
${rev:+This branch is based on $rev. }You can check it out by doing
79+
svn co http://svn.tools.ietf.org/svn/tools/ietfdb/personal/$login/$target
80+
81+
(More instructions about setup is available at
82+
http://trac.tools.ietf.org/tools/ietfdb/wiki/SprintCoderSetup)
83+
84+
85+
Best,
86+
87+
Henrik (via the $program script)
88+
89+
EOF
90+
else
91+
echo " branch personal/$login/$target already exists."
92+
fi
93+
done

test/sprint76.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
henrik henrik@levkowetz.com Henrik Levkowetz
2+
chris chris.newman@sun.com Chris Newman
3+
pasi pasi.eronen@nokia.com Pasi Eronen
4+
rjs rjs@nostrum.com Robert Sparks
5+
tony tony@att.com Tony Hansen
6+
ben ben@nostrum.com Ben Campbell
7+
kivinen kivinen@iki.fi Tero Kivinen
8+
adam adam@nostrum.com Adam Roach
9+
arifumi arifumi@nttv6.net Arifumi Matsumoto
10+
edj edj.etc@gmail.com Ed Juskevicius
11+
lars lars.eggert@gmail.com Lars Eggert

test/sprint77.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
henrik henrik@levkowetz.com Henrik Levkowetz
2+
rjs rjs@nostrum.com Robert Sparks
3+
adam adam@nostrum.com Adam Roach
4+
pasi pasi.eronen@nokia.com Pasi Eronen
5+
kivinen kivinen@iki.fi Tero Kivinen
6+
housley housley@vigilsec.com Russ Housley
7+
tony tony@att.com Tony Hansen
8+
lars lars.eggert@gmail.com Lars Eggert
9+
richard richard.barnes@gmail.com Richard Barnes
10+
cabo cabo@tzi.org Carsten Bormann
11+
ben ben@nostrum.com Ben Campbell
12+
fenner fenner@fenron.net Bill Fenner
13+
suresh suresh.krishnan@ericsson.com Suresh Krishnan
14+
matthijs matthijs@nlnetlabs.nl Matthijs Mekking
15+
edj edj.etc@gmail.com Ed Juskevicius
16+
george george.bullis@jdsu.com George Bullis

test/sprint78.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
henrik henrik@levkowetz.com Henrik Levkowetz
2+
rjs rjs@nostrum.com Robert Sparks
3+
housley housley@vigilsec.com Russ Housley
4+
tony tony@att.com Tony Hansen
5+
lars lars.eggert@gmail.com Lars Eggert
6+
kivinen kivinen@iki.fi Tero Kivinen
7+
peter peter.musgrave@magorcorp.com Peter Musgrave
8+
matthijs matthijs@nlnetlabs.nl Matthijs Mekking
9+
jelte jelte@isc.org Jelte Jansen
10+
yuri yuri@nlnetlabs.nl Yuri Schaeffer
11+
adam adam@nostrum.com Adam Roach
12+
paul paul.hoffman@vpnc.org Paul Hoffman
13+
rcross rcross@amsl.com Ryan Cross
14+
warren warren@kumari.net Warren Kumari

test/sprint79.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
henrik henrik@levkowetz.com Henrik Levkowetz
2+
rjs rjs@nostrum.com Robert Sparks
3+
housley housley@vigilsec.com Russ Housley
4+
tony tony@att.com Tony Hansen
5+
peter peter.musgrave@magorcorp.com Peter Musgrave
6+
warren warren@kumari.net Warren Kumari
7+
suresh suresh.krishnan@ericsson.com Suresh Krishnan
8+
kivinen kivinen@iki.fi Tero Kivinen
9+
lars lars.eggert@gmail.com Lars Eggert
10+
fenner fenner@fenron.net Bill Fenner
11+
adam adam@nostrum.com Adam Roach

test/sprint80.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
henrik henrik@levkowetz.com Henrik Levkowetz
2+
rjs rjs@nostrum.com Robert Sparks
3+
housley housley@vigilsec.com Russ Housley
4+
tony tony@att.com Tony Hansen
5+
rcross rcross@amsl.com Ryan Cross
6+
shane shane@time-travellers.org Shane Kerr
7+
kivinen kivinen@iki.fi Tero Kivinen
8+
adam adam@nostrum.com Adam Roach
9+
peter peter.musgrave@magorcorp.com Peter Musgrave
10+
julian julian.reschke@greenbytes.de Julian Reschke
11+
warren warren@kumari.net Warren Kumari
12+
jelte jelte@isc.org Jelte Jansen
13+
bmheight bmheight@gmail.com Brandon Height
14+
lars lars.eggert@gmail.com Lars Eggert

test/sprint81.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
henrik henrik@levkowetz.com Henrik Levkowetz
2+
rjs rjs@nostrum.com Robert Sparks
3+
housley housley@vigilsec.com Russ Housley
4+
lars lars.eggert@gmail.com Lars Eggert
5+
adam adam@nostrum.com Adam Roach
6+
kivinen kivinen@iki.fi Tero Kivinen
7+
suresh suresh.krishnan@ericsson.com Suresh Krishnan
8+
wes wes@mti-systems.com Wes Eddy
9+
dow dow.street@linquest.com Dow Street
10+
ondrej ondrej@sury.org Ondřej Surý
11+
tony tony@att.com Tony Hansen
12+
rcross rcross@amsl.com Ryan Cross
13+
julian julian.reschke@greenbytes.de Julian Reschke
14+
elwynd elwynd@folly.org.uk Elwyn Davies
15+
presnick presnick@qualcomm.com Pete Resnick

test/sprint82.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
henrik henrik@levkowetz.com Henrik Levkowetz
2+
rjs rjs@nostrum.com Robert Sparks
3+
housley housley@vigilsec.com Russ Housley
4+
adam adam@nostrum.com Adam Roach
5+
lars lars.eggert@gmail.com Lars Eggert
6+
kivinen kivinen@iki.fi Tero Kivinen
7+
tony tony@att.com Tony Hansen
8+
mahoney mahoney@nostrum.com Jean Mahoney

0 commit comments

Comments
 (0)