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