* Makefile.am:
[monodevelop.git] / scripts / mdbranch
blob7e28eb54257327474fdbb6c71569996a956e96ca
1 #!/bin/bash
2 version=1.9
3 prefix=/usr/local
4 profile=dist
5 trunkRoot=svn+ssh://mono-cvs.ximian.com/source/trunk/monodevelop
6 branchesRoot=svn+ssh://mono-cvs.ximian.com/source/branches/monodevelop
7 tagsRoot=svn+ssh://mono-cvs.ximian.com/source/tags/monodevelop
8 srcVersion=
10 sourceRoot=$trunkRoot
11 destRoot=$branchesRoot
13 MSG=`mktemp`
15 usage ()
17 echo "Usage : mdbrach [--profile=PROFILE] versionNumber"
18 echo ""
19 echo "Creates a new branch of MonoDevelop and the extras add-ins included"
20 echo "in the specified profile (which is 'stable' by default)."
23 validate_profile ()
25 test -z "$1" && return 0
26 for c in `ls ../profiles`; do
27 if [ "$c" = "$1" ]; then
28 return 1
30 done
31 return 0
34 read_packages ()
36 for p in `sed -e /#/d -e 's/ /,/g' < ../profiles/$profile` ; do
37 path=`echo $p | cut -d ',' -f 1`
38 packages="$packages $path"
39 done
40 return 0
43 while test x$1 != x; do
44 case $1 in
45 --profile=*)
46 prof=`echo $1 | sed 's/--profile=//'`
47 validate_profile "$prof"
48 if [ $? -eq 1 ]; then
49 profile=$prof
50 else
51 echo "Invalid profile name - $conf"
52 usage
53 exit 1
56 --profile)
57 shift
58 prof=$1
59 validate_profile "$prof"
60 if [ $? -eq 1 ]; then
61 profile=$prof
62 else
63 echo "Invalid profile name - $conf"
64 usage
65 exit 1
68 --tag)
69 shift
70 sourceRoot=$branchesRoot
71 destRoot=$tagsRoot
72 srcVersion="/$1"
74 --help)
75 usage
76 exit
79 version=$1
81 esac
82 shift
83 done
85 read_packages
88 echo ""
89 if [ $destRoot = $tagsRoot ]; then
90 echo "The following tags will be created:"
91 else
92 echo "The following branches will be created:"
95 echo ""
96 for p in $packages; do
97 echo "$destRoot/$p/$version"
98 done
99 echo ""
100 echo "From sources:"
101 echo ""
102 for p in $packages; do
103 echo "$sourceRoot/$p$srcVersion"
104 done
106 if [ $destRoot = $tagsRoot ]; then
107 echo "Created $version tag." > $MSG
108 else
109 echo "Created $version branch." > $MSG
112 echo ""
113 echo "Commit message:"
114 cat $MSG
115 echo ""
117 while [[ 1 ]]
120 read -a RESPONSE -p"Would you like to continue (Y)es/(N)o/(E)dit Message: "
121 if [[ $? != 0 ]]
122 then
123 RESPONSE="N"
126 case $RESPONSE in
127 "Y" | "y" | "yes" | "Yes")
129 echo "Comitting..."
130 for p in $packages; do
131 echo "svn cp -F $MSG $sourceRoot/$p$srcVersion $destRoot/$p/$version"
132 svn cp -F $MSG $sourceRoot/$p$srcVersion $destRoot/$p/$version
133 done
134 rm $MSG
135 exit 0
138 "N" | "n" | "no" | "No")
139 echo "Aborting..."
140 rm $MSG
141 exit 1
144 "E" | "e" | "ed" | "Ed" | "Edit" | "edit")
145 vi $MSG
146 # try again
149 # try again
151 esac
152 done