##// END OF EJS Templates
subrepo: separate out mq+svn subrepo tests...
Kevin Bullock -
r13300:23bbb5b8 default
parent child Browse files
Show More
@@ -0,0 +1,52 b''
1 $ "$TESTDIR/hghave" svn || exit 80
2
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "mq=" >> $HGRCPATH
5 $ echo "[diff]" >> $HGRCPATH
6 $ echo "nodates=1" >> $HGRCPATH
7
8 fn to create new repository w/dirty subrepo, and cd into it
9 $ mkrepo() {
10 > hg init $1
11 > cd $1
12 > hg qinit
13 > }
14
15
16 handle svn subrepos safely
17
18 $ svnadmin create svn-repo-2499
19 $ curpath=`pwd | tr '\\\\' /`
20 $ expr "$svnpath" : "\/" > /dev/null
21 > if [ $? -ne 0 ]; then
22 > curpath="/$curpath"
23 > fi
24 $ svnurl="file://$curpath/svn-repo-2499/project"
25 $ mkdir -p svn-project-2499/trunk
26 $ svn import -m 'init project' svn-project-2499 "$svnurl"
27 Adding svn-project-2499/trunk
28
29 Committed revision 1.
30
31 qnew on repo w/svn subrepo
32 $ mkrepo repo-2499-svn-subrepo
33 $ svn co "$svnurl"/trunk sub
34 Checked out revision 1.
35 $ echo 'sub = [svn]sub' >> .hgsub
36 $ hg add .hgsub
37 $ hg status -S
38 A .hgsub
39 ? sub/.svn/entries
40 $ hg qnew -m0 0.diff
41 committing subrepository sub
42 $ cd sub
43 $ echo a > a
44 $ svn add a
45 A a
46 $ svn st
47 A a
48 $ cd ..
49 $ hg status -S # doesn't show status for svn subrepos (yet)
50 $ hg qnew -m1 1.diff
51 abort: uncommitted changes in subrepository sub
52 [255]
@@ -1,388 +1,347 b''
1 $ "$TESTDIR/hghave" svn || exit 80
2
3 1 $ echo "[extensions]" >> $HGRCPATH
4 2 $ echo "mq=" >> $HGRCPATH
5 3 $ echo "record=" >> $HGRCPATH
6 4 $ echo "[diff]" >> $HGRCPATH
7 5 $ echo "nodates=1" >> $HGRCPATH
8 6
9 7 $ stdin=`pwd`/stdin.tmp
10 8
11 9 fn to create new repository w/dirty subrepo, and cd into it
12 10 $ mkrepo() {
13 11 > hg init $1
14 12 > cd $1
15 13 > hg qinit
16 14 > }
17 15
18 16 fn to create dirty subrepo
19 17 $ mksubrepo() {
20 18 > hg init $1
21 19 > cd $1
22 20 > echo a > a
23 21 > hg add
24 22 > cd ..
25 23 > }
26 24
27 25 $ testadd() {
28 26 > cat - > "$stdin"
29 27 > mksubrepo sub
30 28 > echo sub = sub >> .hgsub
31 29 > hg add .hgsub
32 30 > echo % abort when adding .hgsub w/dirty subrepo
33 31 > hg status -S
34 32 > echo '%' $*
35 33 > cat "$stdin" | hg $*
36 34 > echo [$?]
37 35 > hg -R sub ci -m0sub
38 36 > echo % update substate when adding .hgsub w/clean updated subrepo
39 37 > hg status -S
40 38 > echo '%' $*
41 39 > cat "$stdin" | hg $*
42 40 > hg debugsub
43 41 > }
44 42
45 43 $ testmod() {
46 44 > cat - > "$stdin"
47 45 > mksubrepo sub2
48 46 > echo sub2 = sub2 >> .hgsub
49 47 > echo % abort when modifying .hgsub w/dirty subrepo
50 48 > hg status -S
51 49 > echo '%' $*
52 50 > cat "$stdin" | hg $*
53 51 > echo [$?]
54 52 > hg -R sub2 ci -m0sub2
55 53 > echo % update substate when modifying .hgsub w/clean updated subrepo
56 54 > hg status -S
57 55 > echo '%' $*
58 56 > cat "$stdin" | hg $*
59 57 > hg debugsub
60 58 > }
61 59
62 60 $ testrm1() {
63 61 > cat - > "$stdin"
64 62 > mksubrepo sub3
65 63 > echo sub3 = sub3 >> .hgsub
66 64 > hg ci -Aqmsub3
67 65 > $EXTRA
68 66 > echo b >> sub3/a
69 67 > hg rm .hgsub
70 68 > echo % update substate when removing .hgsub w/dirty subrepo
71 69 > hg status -S
72 70 > echo '%' $*
73 71 > cat "$stdin" | hg $*
74 72 > echo % debugsub should be empty
75 73 > hg debugsub
76 74 > }
77 75
78 76 $ testrm2() {
79 77 > cat - > "$stdin"
80 78 > mksubrepo sub4
81 79 > echo sub4 = sub4 >> .hgsub
82 80 > hg ci -Aqmsub4
83 81 > $EXTRA
84 82 > hg rm .hgsub
85 83 > echo % update substate when removing .hgsub w/clean updated subrepo
86 84 > hg status -S
87 85 > echo '%' $*
88 86 > cat "$stdin" | hg $*
89 87 > echo % debugsub should be empty
90 88 > hg debugsub
91 89 > }
92 90
93 91
94 92 handle subrepos safely on qnew
95 93
96 94 $ mkrepo repo-2499-qnew
97 95 $ testadd qnew -m0 0.diff
98 96 adding a
99 97 % abort when adding .hgsub w/dirty subrepo
100 98 A .hgsub
101 99 A sub/a
102 100 % qnew -m0 0.diff
103 101 abort: uncommitted changes in subrepository sub
104 102 [255]
105 103 % update substate when adding .hgsub w/clean updated subrepo
106 104 A .hgsub
107 105 % qnew -m0 0.diff
108 106 committing subrepository sub
109 107 path sub
110 108 source sub
111 109 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
112 110
113 111 $ testmod qnew -m1 1.diff
114 112 adding a
115 113 % abort when modifying .hgsub w/dirty subrepo
116 114 M .hgsub
117 115 A sub2/a
118 116 % qnew -m1 1.diff
119 117 abort: uncommitted changes in subrepository sub2
120 118 [255]
121 119 % update substate when modifying .hgsub w/clean updated subrepo
122 120 M .hgsub
123 121 % qnew -m1 1.diff
124 122 committing subrepository sub2
125 123 path sub
126 124 source sub
127 125 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
128 126 path sub2
129 127 source sub2
130 128 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
131 129
132 130 $ hg qpop -qa
133 131 patch queue now empty
134 132 $ testrm1 qnew -m2 2.diff
135 133 adding a
136 134 % update substate when removing .hgsub w/dirty subrepo
137 135 M sub3/a
138 136 R .hgsub
139 137 % qnew -m2 2.diff
140 138 % debugsub should be empty
141 139
142 140 $ hg qpop -qa
143 141 patch queue now empty
144 142 $ testrm2 qnew -m3 3.diff
145 143 adding a
146 144 % update substate when removing .hgsub w/clean updated subrepo
147 145 R .hgsub
148 146 % qnew -m3 3.diff
149 147 % debugsub should be empty
150 148
151 149 $ cd ..
152 150
153 151
154 152 handle subrepos safely on qrefresh
155 153
156 154 $ mkrepo repo-2499-qrefresh
157 155 $ hg qnew -m0 0.diff
158 156 $ testadd qrefresh
159 157 adding a
160 158 % abort when adding .hgsub w/dirty subrepo
161 159 A .hgsub
162 160 A sub/a
163 161 % qrefresh
164 162 abort: uncommitted changes in subrepository sub
165 163 [255]
166 164 % update substate when adding .hgsub w/clean updated subrepo
167 165 A .hgsub
168 166 % qrefresh
169 167 committing subrepository sub
170 168 path sub
171 169 source sub
172 170 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
173 171
174 172 $ hg qnew -m1 1.diff
175 173 $ testmod qrefresh
176 174 adding a
177 175 % abort when modifying .hgsub w/dirty subrepo
178 176 M .hgsub
179 177 A sub2/a
180 178 % qrefresh
181 179 abort: uncommitted changes in subrepository sub2
182 180 [255]
183 181 % update substate when modifying .hgsub w/clean updated subrepo
184 182 M .hgsub
185 183 % qrefresh
186 184 committing subrepository sub2
187 185 path sub
188 186 source sub
189 187 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
190 188 path sub2
191 189 source sub2
192 190 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
193 191
194 192 $ hg qpop -qa
195 193 patch queue now empty
196 194 $ EXTRA='hg qnew -m2 2.diff' testrm1 qrefresh
197 195 adding a
198 196 % update substate when removing .hgsub w/dirty subrepo
199 197 M sub3/a
200 198 R .hgsub
201 199 % qrefresh
202 200 % debugsub should be empty
203 201
204 202 $ hg qpop -qa
205 203 patch queue now empty
206 204 $ EXTRA='hg qnew -m3 3.diff' testrm2 qrefresh
207 205 adding a
208 206 % update substate when removing .hgsub w/clean updated subrepo
209 207 R .hgsub
210 208 % qrefresh
211 209 % debugsub should be empty
212 210
213 211 $ cd ..
214 212
215 213
216 214 handle subrepos safely on qpush/qpop
217 215
218 216 $ mkrepo repo-2499-qpush
219 217 $ mksubrepo sub
220 218 adding a
221 219 $ hg -R sub ci -m0sub
222 220 $ echo sub = sub > .hgsub
223 221 $ hg add .hgsub
224 222 $ hg qnew -m0 0.diff
225 223 committing subrepository sub
226 224 $ hg debugsub
227 225 path sub
228 226 source sub
229 227 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
230 228
231 229 qpop
232 230 $ hg qpop
233 231 popping 0.diff
234 232 patch queue now empty
235 233 $ hg status -AS
236 234 $ hg debugsub
237 235
238 236 qpush
239 237 $ hg qpush
240 238 applying 0.diff
241 239 now at: 0.diff
242 240 $ hg status -AS
243 241 C .hgsub
244 242 C .hgsubstate
245 243 C sub/a
246 244 $ hg debugsub
247 245 path sub
248 246 source sub
249 247 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
250 248
251 249 $ cd ..
252 250
253 251
254 252 handle subrepos safely on qrecord
255 253
256 254 $ mkrepo repo-2499-qrecord
257 255 $ testadd qrecord --config ui.interactive=1 -m0 0.diff <<EOF
258 256 > y
259 257 > y
260 258 > EOF
261 259 adding a
262 260 % abort when adding .hgsub w/dirty subrepo
263 261 A .hgsub
264 262 A sub/a
265 263 % qrecord --config ui.interactive=1 -m0 0.diff
266 264 diff --git a/.hgsub b/.hgsub
267 265 new file mode 100644
268 266 examine changes to '.hgsub'? [Ynsfdaq?]
269 267 abort: uncommitted changes in subrepository sub
270 268 [255]
271 269 % update substate when adding .hgsub w/clean updated subrepo
272 270 A .hgsub
273 271 % qrecord --config ui.interactive=1 -m0 0.diff
274 272 diff --git a/.hgsub b/.hgsub
275 273 new file mode 100644
276 274 examine changes to '.hgsub'? [Ynsfdaq?]
277 275 committing subrepository sub
278 276 path sub
279 277 source sub
280 278 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
281 279
282 280 $ testmod qrecord --config ui.interactive=1 -m1 1.diff <<EOF
283 281 > y
284 282 > y
285 283 > EOF
286 284 adding a
287 285 % abort when modifying .hgsub w/dirty subrepo
288 286 M .hgsub
289 287 A sub2/a
290 288 % qrecord --config ui.interactive=1 -m1 1.diff
291 289 diff --git a/.hgsub b/.hgsub
292 290 1 hunks, 1 lines changed
293 291 examine changes to '.hgsub'? [Ynsfdaq?]
294 292 @@ -1,1 +1,2 @@
295 293 sub = sub
296 294 +sub2 = sub2
297 295 record this change to '.hgsub'? [Ynsfdaq?]
298 296 abort: uncommitted changes in subrepository sub2
299 297 [255]
300 298 % update substate when modifying .hgsub w/clean updated subrepo
301 299 M .hgsub
302 300 % qrecord --config ui.interactive=1 -m1 1.diff
303 301 diff --git a/.hgsub b/.hgsub
304 302 1 hunks, 1 lines changed
305 303 examine changes to '.hgsub'? [Ynsfdaq?]
306 304 @@ -1,1 +1,2 @@
307 305 sub = sub
308 306 +sub2 = sub2
309 307 record this change to '.hgsub'? [Ynsfdaq?]
310 308 committing subrepository sub2
311 309 path sub
312 310 source sub
313 311 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
314 312 path sub2
315 313 source sub2
316 314 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
317 315
318 316 $ hg qpop -qa
319 317 patch queue now empty
320 318 $ EXTRA= testrm1 qrecord --config ui.interactive=1 -m2 2.diff <<EOF
321 319 > y
322 320 > y
323 321 > EOF
324 322 adding a
325 323 % update substate when removing .hgsub w/dirty subrepo
326 324 M sub3/a
327 325 R .hgsub
328 326 % qrecord --config ui.interactive=1 -m2 2.diff
329 327 diff --git a/.hgsub b/.hgsub
330 328 deleted file mode 100644
331 329 examine changes to '.hgsub'? [Ynsfdaq?]
332 330 % debugsub should be empty
333 331
334 332 $ hg qpop -qa
335 333 patch queue now empty
336 334 $ EXTRA= testrm2 qrecord --config ui.interactive=1 -m3 3.diff <<EOF
337 335 > y
338 336 > y
339 337 > EOF
340 338 adding a
341 339 % update substate when removing .hgsub w/clean updated subrepo
342 340 R .hgsub
343 341 % qrecord --config ui.interactive=1 -m3 3.diff
344 342 diff --git a/.hgsub b/.hgsub
345 343 deleted file mode 100644
346 344 examine changes to '.hgsub'? [Ynsfdaq?]
347 345 % debugsub should be empty
348 346
349 347 $ cd ..
350
351
352 handle svn subrepos safely
353
354 $ svnadmin create svn-repo-2499
355 $ curpath=`pwd | tr '\\\\' /`
356 $ expr "$svnpath" : "\/" > /dev/null
357 > if [ $? -ne 0 ]; then
358 > curpath="/$curpath"
359 > fi
360 $ svnurl="file://$curpath/svn-repo-2499/project"
361 $ mkdir -p svn-project-2499/trunk
362 $ svn import -m 'init project' svn-project-2499 "$svnurl"
363 Adding svn-project-2499/trunk
364
365 Committed revision 1.
366
367 qnew on repo w/svn subrepo
368 $ mkrepo repo-2499-svn-subrepo
369 $ svn co "$svnurl"/trunk sub
370 Checked out revision 1.
371 $ echo 'sub = [svn]sub' >> .hgsub
372 $ hg add .hgsub
373 $ hg status -S
374 A .hgsub
375 ? sub/.svn/entries
376 $ hg qnew -m0 0.diff
377 committing subrepository sub
378 $ cd sub
379 $ echo a > a
380 $ svn add a
381 A a
382 $ svn st
383 A a
384 $ cd ..
385 $ hg status -S # doesn't show status for svn subrepos (yet)
386 $ hg qnew -m1 1.diff
387 abort: uncommitted changes in subrepository sub
388 [255]
General Comments 0
You need to be logged in to leave comments. Login now