1 | #!/bin/ksh |
---|
2 | set -eu |
---|
3 | |
---|
4 | REPOS_FILES=$MY_BIN/repos |
---|
5 | |
---|
6 | echo "$(date): Creating repository ..." |
---|
7 | rm -rf $REPOS_DIR |
---|
8 | svnadmin create --fs-type fsfs $REPOS_DIR |
---|
9 | |
---|
10 | echo "$(date): Initial import ..." |
---|
11 | |
---|
12 | svn import -q $REPOS_FILES/trunk $REPOS_URL/trunk -m" " |
---|
13 | svn mkdir -q $REPOS_URL/branches -m" " |
---|
14 | svn mkdir -q $REPOS_URL/tags -m" " |
---|
15 | |
---|
16 | # Modify some files |
---|
17 | branch=modify_files_base |
---|
18 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
19 | rm -rf $BASE_DIR/work |
---|
20 | svn co -q $REPOS_URL/branches/dev/Share/$branch $BASE_DIR/work |
---|
21 | cd $BASE_DIR/work |
---|
22 | perl -pi -e 's/IMPLICIT NONE/implicit none/' program/hello.F90 |
---|
23 | perl -pi -e 's/Hello Earth/Hello Earthlings/' module/hello_constants.inc |
---|
24 | svn ci -m" " |
---|
25 | |
---|
26 | # Modify some files, one of which can be merged with modify_files_base branch |
---|
27 | branch=modify_files_merge1 |
---|
28 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
29 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
30 | perl -pi -e "s/this = 'Hello'/this = 'HELLO'/" program/hello.F90 |
---|
31 | perl -pi -e 's/Hello Earth/Hello Earthlings/' subroutine/hello_c.c |
---|
32 | svn ci -m" " |
---|
33 | |
---|
34 | # Modify a file which can be merged with the modify_files_base & modify_files_merge1 branches |
---|
35 | branch=modify_files_merge2 |
---|
36 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
37 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
38 | perl -pi -e 's/PROGRAM/program/' program/hello.F90 |
---|
39 | svn ci -m" " |
---|
40 | |
---|
41 | # Modify a file which clashes with modify_files_base branch |
---|
42 | branch=modify_files_clash |
---|
43 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
44 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
45 | perl -pi -e 's/IMPLICIT NONE/implicit NONE/' program/hello.F90 |
---|
46 | svn ci -m" " |
---|
47 | |
---|
48 | # Modify a subroutine without altering its interface |
---|
49 | branch=modify_subroutine |
---|
50 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
51 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
52 | perl -pi -e 's/integer (common)/integer (com)/' subroutine/hello_sub.F90 |
---|
53 | svn ci -m" " |
---|
54 | |
---|
55 | # Modify a subroutine and alter its interface |
---|
56 | branch=modify_subroutine_interface |
---|
57 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
58 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
59 | perl -pi -e 's/integer_arg/int_arg/' subroutine/hello_sub.F90 |
---|
60 | svn ci -m" " |
---|
61 | |
---|
62 | # Modify a pre-processing include file |
---|
63 | branch=modify_pp_include |
---|
64 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
65 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
66 | perl -pi -e 's/:/: Message - /' subroutine/hello_sub.h |
---|
67 | svn ci -m" " |
---|
68 | |
---|
69 | # Add lines to a file to coincide with following branch |
---|
70 | branch=add_lines |
---|
71 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
72 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
73 | cp $REPOS_FILES/add_subroutine/hello.F90.add_lines program/hello.F90 |
---|
74 | svn ci -m" " |
---|
75 | |
---|
76 | # Add a new file |
---|
77 | branch=add_file |
---|
78 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
79 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
80 | cp $REPOS_FILES/add_subroutine/hello.F90 program/hello.F90 |
---|
81 | cp $REPOS_FILES/add_subroutine/hello_sub2.f90 subroutine |
---|
82 | svn add subroutine/hello_sub2.f90 |
---|
83 | svn ci -m" " |
---|
84 | |
---|
85 | # Add a new directory |
---|
86 | branch=add_directory |
---|
87 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
88 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
89 | cp $REPOS_FILES/add_subroutine/hello.F90 program/hello.F90 |
---|
90 | mkdir subroutine2 |
---|
91 | cp $REPOS_FILES/add_subroutine/hello_sub2.f90 subroutine2 |
---|
92 | svn add subroutine2 |
---|
93 | svn ci -m" " |
---|
94 | |
---|
95 | # Add a duplicate subroutine |
---|
96 | branch=add_duplicate |
---|
97 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
98 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
99 | cp subroutine/hello_sub.F90 subroutine/hello_sub2.F90 |
---|
100 | svn add subroutine/hello_sub2.F90 |
---|
101 | svn ci -m" " |
---|
102 | |
---|
103 | # Delete a file |
---|
104 | branch=delete_file |
---|
105 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
106 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
107 | svn rm subroutine/hello_c.c |
---|
108 | svn ci -m" " |
---|
109 | |
---|
110 | # Delete a CPP file |
---|
111 | branch=delete_pp_file |
---|
112 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
113 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
114 | svn rm subroutine/hello_sub.F90 |
---|
115 | svn ci -m" " |
---|
116 | |
---|
117 | # Delete a Fortran include file |
---|
118 | branch=delete_inc_file |
---|
119 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
120 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
121 | svn rm module/hello_constants.inc |
---|
122 | svn ci -m" " |
---|
123 | |
---|
124 | # Delete a CPP include file |
---|
125 | branch=delete_ppinc_file |
---|
126 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
127 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
128 | svn rm subroutine/hello_sub.h |
---|
129 | svn ci -m" " |
---|
130 | |
---|
131 | # Delete a directory |
---|
132 | branch=delete_directory |
---|
133 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
134 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
135 | svn rm subroutine |
---|
136 | svn ci -m" " |
---|
137 | |
---|
138 | # Rename the executable |
---|
139 | branch=exe_rename |
---|
140 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
141 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
142 | perl -pi -e 's/hello.exe/hello_world.exe/' script/hello.sh |
---|
143 | svn ci -m" " |
---|
144 | |
---|
145 | # Use a .f90 file as an include file |
---|
146 | branch=change_src_type |
---|
147 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
148 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
149 | perl -pi -e 's/hello_constants.inc/hello_constants_inc.f90/g' module/hello_constants_dummy.inc |
---|
150 | svn mv module/hello_constants.inc module/hello_constants_inc.f90 |
---|
151 | svn ci -m" " |
---|
152 | |
---|
153 | # Add a symbolic link |
---|
154 | branch=symbolic_link |
---|
155 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
156 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
157 | cd subroutine |
---|
158 | ln -s hello_sub.F90 hello_sub2.F90 |
---|
159 | svn add hello_sub2.F90 |
---|
160 | cd $OLDPWD |
---|
161 | svn ci -m" " |
---|
162 | |
---|
163 | # Use space in a path name |
---|
164 | branch=space_in_name |
---|
165 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
166 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
167 | svn mv blockdata/hello_blockdata.F90 "blockdata/hello blockdata.F90" |
---|
168 | svn mv --force blockdata "block data" |
---|
169 | svn ci -m" " |
---|
170 | |
---|
171 | # Create a cylc dependency which will fail |
---|
172 | branch=cyclic_dep_fail |
---|
173 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
174 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
175 | cp $REPOS_FILES/cyclic_dependency/hello.F90 program/hello.F90 |
---|
176 | cp $REPOS_FILES/cyclic_dependency/hello_constants.f90.fail module/hello_constants.f90 |
---|
177 | svn ci -m" " |
---|
178 | |
---|
179 | # Create a cylc dependency which should be OK |
---|
180 | branch=cyclic_dep_ok |
---|
181 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
182 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
183 | cp $REPOS_FILES/cyclic_dependency/hello.F90 program/hello.F90 |
---|
184 | cp $REPOS_FILES/cyclic_dependency/hello_constants.f90.ok module/hello_constants.f90 |
---|
185 | cp $REPOS_FILES/cyclic_dependency/hello_sub2.f90 subroutine |
---|
186 | svn add subroutine/hello_sub2.f90 |
---|
187 | svn ci -m" " |
---|
188 | |
---|
189 | # Create a dependency which needs to be defined manually |
---|
190 | branch=f77_dep |
---|
191 | fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1 |
---|
192 | svn sw $REPOS_URL/branches/dev/Share/$branch |
---|
193 | perl -pi -e 's/INCLUDE /!INCLUDE /' program/hello.F90 |
---|
194 | svn ci -m" " |
---|
195 | |
---|
196 | rm -rf $BASE_DIR/work |
---|
197 | echo "$(date): Finished" |
---|