##// END OF EJS Templates
test-rebase-interruptions: stabilize for Windows...
Matt Harbison -
r33170:4b0da963 default
parent child Browse files
Show More
@@ -1,460 +1,465 b''
1 1 $ cat >> $HGRCPATH <<EOF
2 2 > [extensions]
3 3 > rebase=
4 4 >
5 5 > [phases]
6 6 > publish=False
7 7 >
8 8 > [alias]
9 9 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
10 10 > tglogp = log -G --template "{rev}:{phase} '{desc}' {branches}\n"
11 11 > EOF
12 12
13 13
14 14 $ hg init a
15 15 $ cd a
16 16
17 17 $ echo A > A
18 18 $ hg ci -Am A
19 19 adding A
20 20
21 21 $ echo B > B
22 22 $ hg ci -Am B
23 23 adding B
24 24
25 25 $ echo C >> A
26 26 $ hg ci -m C
27 27
28 28 $ hg up -q -C 0
29 29
30 30 $ echo D >> A
31 31 $ hg ci -m D
32 32 created new head
33 33
34 34 $ echo E > E
35 35 $ hg ci -Am E
36 36 adding E
37 37
38 38 $ cd ..
39 39
40 40
41 41 Changes during an interruption - continue:
42 42
43 43 $ hg clone -q -u . a a1
44 44 $ cd a1
45 45
46 46 $ hg tglog
47 47 @ 4: 'E'
48 48 |
49 49 o 3: 'D'
50 50 |
51 51 | o 2: 'C'
52 52 | |
53 53 | o 1: 'B'
54 54 |/
55 55 o 0: 'A'
56 56
57 57 Rebasing B onto E:
58 58
59 59 $ hg rebase -s 1 -d 4
60 60 rebasing 1:27547f69f254 "B"
61 61 rebasing 2:965c486023db "C"
62 62 merging A
63 63 warning: conflicts while merging A! (edit, then use 'hg resolve --mark')
64 64 unresolved conflicts (see hg resolve, then hg rebase --continue)
65 65 [1]
66 66
67 67 Force a commit on C during the interruption:
68 68
69 69 $ hg up -q -C 2 --config 'extensions.rebase=!'
70 70
71 71 $ echo 'Extra' > Extra
72 72 $ hg add Extra
73 73 $ hg ci -m 'Extra' --config 'extensions.rebase=!'
74 74
75 75 Force this commit onto secret phase
76 76
77 77 $ hg phase --force --secret 6
78 78
79 79 $ hg tglogp
80 80 @ 6:secret 'Extra'
81 81 |
82 82 | o 5:draft 'B'
83 83 | |
84 84 | o 4:draft 'E'
85 85 | |
86 86 | o 3:draft 'D'
87 87 | |
88 88 o | 2:draft 'C'
89 89 | |
90 90 o | 1:draft 'B'
91 91 |/
92 92 o 0:draft 'A'
93 93
94 94 Resume the rebasing:
95 95
96 96 $ hg rebase --continue
97 97 already rebased 1:27547f69f254 "B" as 45396c49d53b
98 98 rebasing 2:965c486023db "C"
99 99 merging A
100 100 warning: conflicts while merging A! (edit, then use 'hg resolve --mark')
101 101 unresolved conflicts (see hg resolve, then hg rebase --continue)
102 102 [1]
103 103
104 104 Solve the conflict and go on:
105 105
106 106 $ echo 'conflict solved' > A
107 107 $ rm A.orig
108 108 $ hg resolve -m A
109 109 (no more unresolved files)
110 110 continue: hg rebase --continue
111 111
112 112 $ hg rebase --continue
113 113 already rebased 1:27547f69f254 "B" as 45396c49d53b
114 114 rebasing 2:965c486023db "C"
115 115 warning: new changesets detected on source branch, not stripping
116 116
117 117 $ hg tglogp
118 118 o 7:draft 'C'
119 119 |
120 120 | o 6:secret 'Extra'
121 121 | |
122 122 o | 5:draft 'B'
123 123 | |
124 124 @ | 4:draft 'E'
125 125 | |
126 126 o | 3:draft 'D'
127 127 | |
128 128 | o 2:draft 'C'
129 129 | |
130 130 | o 1:draft 'B'
131 131 |/
132 132 o 0:draft 'A'
133 133
134 134 $ cd ..
135 135
136 136
137 137 Changes during an interruption - abort:
138 138
139 139 $ hg clone -q -u . a a2
140 140 $ cd a2
141 141
142 142 $ hg tglog
143 143 @ 4: 'E'
144 144 |
145 145 o 3: 'D'
146 146 |
147 147 | o 2: 'C'
148 148 | |
149 149 | o 1: 'B'
150 150 |/
151 151 o 0: 'A'
152 152
153 153 Rebasing B onto E:
154 154
155 155 $ hg rebase -s 1 -d 4
156 156 rebasing 1:27547f69f254 "B"
157 157 rebasing 2:965c486023db "C"
158 158 merging A
159 159 warning: conflicts while merging A! (edit, then use 'hg resolve --mark')
160 160 unresolved conflicts (see hg resolve, then hg rebase --continue)
161 161 [1]
162 162
163 163 Force a commit on B' during the interruption:
164 164
165 165 $ hg up -q -C 5 --config 'extensions.rebase=!'
166 166
167 167 $ echo 'Extra' > Extra
168 168 $ hg add Extra
169 169 $ hg ci -m 'Extra' --config 'extensions.rebase=!'
170 170
171 171 $ hg tglog
172 172 @ 6: 'Extra'
173 173 |
174 174 o 5: 'B'
175 175 |
176 176 o 4: 'E'
177 177 |
178 178 o 3: 'D'
179 179 |
180 180 | o 2: 'C'
181 181 | |
182 182 | o 1: 'B'
183 183 |/
184 184 o 0: 'A'
185 185
186 186 Abort the rebasing:
187 187
188 188 $ hg rebase --abort
189 189 warning: new changesets detected on destination branch, can't strip
190 190 rebase aborted
191 191
192 192 $ hg tglog
193 193 @ 6: 'Extra'
194 194 |
195 195 o 5: 'B'
196 196 |
197 197 o 4: 'E'
198 198 |
199 199 o 3: 'D'
200 200 |
201 201 | o 2: 'C'
202 202 | |
203 203 | o 1: 'B'
204 204 |/
205 205 o 0: 'A'
206 206
207 207 $ cd ..
208 208
209 209 Changes during an interruption - abort (again):
210 210
211 211 $ hg clone -q -u . a a3
212 212 $ cd a3
213 213
214 214 $ hg tglogp
215 215 @ 4:draft 'E'
216 216 |
217 217 o 3:draft 'D'
218 218 |
219 219 | o 2:draft 'C'
220 220 | |
221 221 | o 1:draft 'B'
222 222 |/
223 223 o 0:draft 'A'
224 224
225 225 Rebasing B onto E:
226 226
227 227 $ hg rebase -s 1 -d 4
228 228 rebasing 1:27547f69f254 "B"
229 229 rebasing 2:965c486023db "C"
230 230 merging A
231 231 warning: conflicts while merging A! (edit, then use 'hg resolve --mark')
232 232 unresolved conflicts (see hg resolve, then hg rebase --continue)
233 233 [1]
234 234
235 235 Change phase on B and B'
236 236
237 237 $ hg up -q -C 5 --config 'extensions.rebase=!'
238 238 $ hg phase --public 1
239 239 $ hg phase --public 5
240 240 $ hg phase --secret -f 2
241 241
242 242 $ hg tglogp
243 243 @ 5:public 'B'
244 244 |
245 245 o 4:public 'E'
246 246 |
247 247 o 3:public 'D'
248 248 |
249 249 | o 2:secret 'C'
250 250 | |
251 251 | o 1:public 'B'
252 252 |/
253 253 o 0:public 'A'
254 254
255 255 Abort the rebasing:
256 256
257 257 $ hg rebase --abort
258 258 warning: can't clean up public changesets 45396c49d53b
259 259 rebase aborted
260 260
261 261 $ hg tglogp
262 262 @ 5:public 'B'
263 263 |
264 264 o 4:public 'E'
265 265 |
266 266 o 3:public 'D'
267 267 |
268 268 | o 2:secret 'C'
269 269 | |
270 270 | o 1:public 'B'
271 271 |/
272 272 o 0:public 'A'
273 273
274 274 Test rebase interrupted by hooks
275 275
276 276 $ hg up 2
277 277 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
278 278 $ echo F > F
279 279 $ hg add F
280 280 $ hg ci -m F
281 281
282 282 $ cd ..
283 283
284 284 (precommit version)
285 285
286 286 $ cp -R a3 hook-precommit
287 287 $ cd hook-precommit
288 288 $ hg rebase --source 2 --dest 5 --tool internal:other --config 'hooks.precommit=hg status | grep "M A"'
289 289 rebasing 2:965c486023db "C"
290 290 M A
291 291 rebasing 6:a0b2430ebfb8 "F" (tip)
292 292 abort: precommit hook exited with status 1
293 293 [255]
294 294 $ hg tglogp
295 295 @ 7:secret 'C'
296 296 |
297 297 | @ 6:secret 'F'
298 298 | |
299 299 o | 5:public 'B'
300 300 | |
301 301 o | 4:public 'E'
302 302 | |
303 303 o | 3:public 'D'
304 304 | |
305 305 | o 2:secret 'C'
306 306 | |
307 307 | o 1:public 'B'
308 308 |/
309 309 o 0:public 'A'
310 310
311 311 $ hg rebase --continue
312 312 already rebased 2:965c486023db "C" as 401ccec5e39f
313 313 rebasing 6:a0b2430ebfb8 "F"
314 314 saved backup bundle to $TESTTMP/hook-precommit/.hg/strip-backup/965c486023db-aa6250e7-backup.hg (glob)
315 315 $ hg tglogp
316 316 @ 6:secret 'F'
317 317 |
318 318 o 5:secret 'C'
319 319 |
320 320 o 4:public 'B'
321 321 |
322 322 o 3:public 'E'
323 323 |
324 324 o 2:public 'D'
325 325 |
326 326 | o 1:public 'B'
327 327 |/
328 328 o 0:public 'A'
329 329
330 330 $ cd ..
331 331
332 332 (pretxncommit version)
333 333
334 334 $ cp -R a3 hook-pretxncommit
335 335 $ cd hook-pretxncommit
336 $ hg rebase --source 2 --dest 5 --tool internal:other --config 'hooks.pretxncommit=hg log -r $HG_NODE | grep "summary: C"'
336 #if windows
337 $ NODE="%HG_NODE%"
338 #else
339 $ NODE="\$HG_NODE"
340 #endif
341 $ hg rebase --source 2 --dest 5 --tool internal:other --config "hooks.pretxncommit=hg log -r $NODE | grep \"summary: C\""
337 342 rebasing 2:965c486023db "C"
338 343 summary: C
339 344 rebasing 6:a0b2430ebfb8 "F" (tip)
340 345 transaction abort!
341 346 rollback completed
342 347 abort: pretxncommit hook exited with status 1
343 348 [255]
344 349 $ hg tglogp
345 350 @ 7:secret 'C'
346 351 |
347 352 | @ 6:secret 'F'
348 353 | |
349 354 o | 5:public 'B'
350 355 | |
351 356 o | 4:public 'E'
352 357 | |
353 358 o | 3:public 'D'
354 359 | |
355 360 | o 2:secret 'C'
356 361 | |
357 362 | o 1:public 'B'
358 363 |/
359 364 o 0:public 'A'
360 365
361 366 $ hg rebase --continue
362 367 already rebased 2:965c486023db "C" as 401ccec5e39f
363 368 rebasing 6:a0b2430ebfb8 "F"
364 369 saved backup bundle to $TESTTMP/hook-pretxncommit/.hg/strip-backup/965c486023db-aa6250e7-backup.hg (glob)
365 370 $ hg tglogp
366 371 @ 6:secret 'F'
367 372 |
368 373 o 5:secret 'C'
369 374 |
370 375 o 4:public 'B'
371 376 |
372 377 o 3:public 'E'
373 378 |
374 379 o 2:public 'D'
375 380 |
376 381 | o 1:public 'B'
377 382 |/
378 383 o 0:public 'A'
379 384
380 385 $ cd ..
381 386
382 387 (pretxnclose version)
383 388
384 389 $ cp -R a3 hook-pretxnclose
385 390 $ cd hook-pretxnclose
386 391 $ hg rebase --source 2 --dest 5 --tool internal:other --config 'hooks.pretxnclose=hg log -r tip | grep "summary: C"'
387 392 rebasing 2:965c486023db "C"
388 393 summary: C
389 394 rebasing 6:a0b2430ebfb8 "F" (tip)
390 395 transaction abort!
391 396 rollback completed
392 397 abort: pretxnclose hook exited with status 1
393 398 [255]
394 399 $ hg tglogp
395 400 @ 7:secret 'C'
396 401 |
397 402 | @ 6:secret 'F'
398 403 | |
399 404 o | 5:public 'B'
400 405 | |
401 406 o | 4:public 'E'
402 407 | |
403 408 o | 3:public 'D'
404 409 | |
405 410 | o 2:secret 'C'
406 411 | |
407 412 | o 1:public 'B'
408 413 |/
409 414 o 0:public 'A'
410 415
411 416 $ hg rebase --continue
412 417 already rebased 2:965c486023db "C" as 401ccec5e39f
413 418 rebasing 6:a0b2430ebfb8 "F"
414 419 saved backup bundle to $TESTTMP/hook-pretxnclose/.hg/strip-backup/965c486023db-aa6250e7-backup.hg (glob)
415 420 $ hg tglogp
416 421 @ 6:secret 'F'
417 422 |
418 423 o 5:secret 'C'
419 424 |
420 425 o 4:public 'B'
421 426 |
422 427 o 3:public 'E'
423 428 |
424 429 o 2:public 'D'
425 430 |
426 431 | o 1:public 'B'
427 432 |/
428 433 o 0:public 'A'
429 434
430 435 $ cd ..
431 436
432 437 Make sure merge state is cleaned up after a no-op rebase merge (issue5494)
433 438 $ hg init repo
434 439 $ cd repo
435 440 $ echo a > a
436 441 $ hg commit -qAm base
437 442 $ echo b >> a
438 443 $ hg commit -qm b
439 444 $ hg up '.^'
440 445 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
441 446 $ echo c >> a
442 447 $ hg commit -qm c
443 448 $ hg rebase -s 1 -d 2 --noninteractive
444 449 rebasing 1:fdaca8533b86 "b"
445 450 merging a
446 451 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
447 452 unresolved conflicts (see hg resolve, then hg rebase --continue)
448 453 [1]
449 454 $ echo a > a
450 455 $ echo c >> a
451 456 $ hg resolve --mark a
452 457 (no more unresolved files)
453 458 continue: hg rebase --continue
454 459 $ hg rebase --continue
455 460 rebasing 1:fdaca8533b86 "b"
456 461 note: rebase of 1:fdaca8533b86 created no changes to commit
457 462 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/fdaca8533b86-7fd70513-backup.hg (glob)
458 463 $ hg resolve --list
459 464 $ test -f .hg/merge
460 465 [1]
General Comments 0
You need to be logged in to leave comments. Login now