##// END OF EJS Templates
py3: add b'' prefixes in tests/test-rebase-scenario-global.t...
Pulkit Goyal -
r36494:263368dc default
parent child Browse files
Show More
@@ -1,984 +1,984 b''
1 1 $ cat >> $HGRCPATH <<EOF
2 2 > [extensions]
3 3 > rebase=
4 4 > drawdag=$TESTDIR/drawdag.py
5 5 >
6 6 > [phases]
7 7 > publish=False
8 8 >
9 9 > [alias]
10 10 > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n"
11 11 > EOF
12 12
13 13
14 14 $ hg init a
15 15 $ cd a
16 16 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
17 17 adding changesets
18 18 adding manifests
19 19 adding file changes
20 20 added 8 changesets with 7 changes to 7 files (+2 heads)
21 21 new changesets cd010b8cd998:02de42196ebe
22 22 (run 'hg heads' to see heads, 'hg merge' to merge)
23 23 $ hg up tip
24 24 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
25 25 $ cd ..
26 26
27 27
28 28 Rebasing
29 29 D onto H - simple rebase:
30 30 (this also tests that editor is invoked if '--edit' is specified, and that we
31 31 can abort or warn for colliding untracked files)
32 32
33 33 $ hg clone -q -u . a a1
34 34 $ cd a1
35 35
36 36 $ hg tglog
37 37 @ 7: 02de42196ebe 'H'
38 38 |
39 39 | o 6: eea13746799a 'G'
40 40 |/|
41 41 o | 5: 24b6387c8c8c 'F'
42 42 | |
43 43 | o 4: 9520eea781bc 'E'
44 44 |/
45 45 | o 3: 32af7686d403 'D'
46 46 | |
47 47 | o 2: 5fddd98957c8 'C'
48 48 | |
49 49 | o 1: 42ccdea3bb16 'B'
50 50 |/
51 51 o 0: cd010b8cd998 'A'
52 52
53 53
54 54 $ hg status --rev "3^1" --rev 3
55 55 A D
56 56 $ echo collide > D
57 57 $ HGEDITOR=cat hg rebase -s 3 -d 7 --edit --config merge.checkunknown=warn
58 58 rebasing 3:32af7686d403 "D"
59 59 D: replacing untracked file
60 60 D
61 61
62 62
63 63 HG: Enter commit message. Lines beginning with 'HG:' are removed.
64 64 HG: Leave message empty to abort commit.
65 65 HG: --
66 66 HG: user: Nicolas Dumazet <nicdumz.commits@gmail.com>
67 67 HG: branch 'default'
68 68 HG: added D
69 69 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/32af7686d403-6f7dface-rebase.hg
70 70 $ cat D.orig
71 71 collide
72 72 $ rm D.orig
73 73
74 74 $ hg tglog
75 75 o 7: 1619f02ff7dd 'D'
76 76 |
77 77 @ 6: 02de42196ebe 'H'
78 78 |
79 79 | o 5: eea13746799a 'G'
80 80 |/|
81 81 o | 4: 24b6387c8c8c 'F'
82 82 | |
83 83 | o 3: 9520eea781bc 'E'
84 84 |/
85 85 | o 2: 5fddd98957c8 'C'
86 86 | |
87 87 | o 1: 42ccdea3bb16 'B'
88 88 |/
89 89 o 0: cd010b8cd998 'A'
90 90
91 91 $ cd ..
92 92
93 93
94 94 D onto F - intermediate point:
95 95 (this also tests that editor is not invoked if '--edit' is not specified, and
96 96 that we can ignore for colliding untracked files)
97 97
98 98 $ hg clone -q -u . a a2
99 99 $ cd a2
100 100 $ echo collide > D
101 101
102 102 $ HGEDITOR=cat hg rebase -s 3 -d 5 --config merge.checkunknown=ignore
103 103 rebasing 3:32af7686d403 "D"
104 104 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/32af7686d403-6f7dface-rebase.hg
105 105 $ cat D.orig
106 106 collide
107 107 $ rm D.orig
108 108
109 109 $ hg tglog
110 110 o 7: 2107530e74ab 'D'
111 111 |
112 112 | @ 6: 02de42196ebe 'H'
113 113 |/
114 114 | o 5: eea13746799a 'G'
115 115 |/|
116 116 o | 4: 24b6387c8c8c 'F'
117 117 | |
118 118 | o 3: 9520eea781bc 'E'
119 119 |/
120 120 | o 2: 5fddd98957c8 'C'
121 121 | |
122 122 | o 1: 42ccdea3bb16 'B'
123 123 |/
124 124 o 0: cd010b8cd998 'A'
125 125
126 126 $ cd ..
127 127
128 128
129 129 E onto H - skip of G:
130 130 (this also tests that we can overwrite untracked files and don't create backups
131 131 if they have the same contents)
132 132
133 133 $ hg clone -q -u . a a3
134 134 $ cd a3
135 135 $ hg cat -r 4 E | tee E
136 136 E
137 137
138 138 $ hg rebase -s 4 -d 7
139 139 rebasing 4:9520eea781bc "E"
140 140 rebasing 6:eea13746799a "G"
141 141 note: rebase of 6:eea13746799a created no changes to commit
142 142 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/9520eea781bc-fcd8edd4-rebase.hg
143 143 $ f E.orig
144 144 E.orig: file not found
145 145
146 146 $ hg tglog
147 147 o 6: 9f8b8ec77260 'E'
148 148 |
149 149 @ 5: 02de42196ebe 'H'
150 150 |
151 151 o 4: 24b6387c8c8c 'F'
152 152 |
153 153 | o 3: 32af7686d403 'D'
154 154 | |
155 155 | o 2: 5fddd98957c8 'C'
156 156 | |
157 157 | o 1: 42ccdea3bb16 'B'
158 158 |/
159 159 o 0: cd010b8cd998 'A'
160 160
161 161 $ cd ..
162 162
163 163
164 164 F onto E - rebase of a branching point (skip G):
165 165
166 166 $ hg clone -q -u . a a4
167 167 $ cd a4
168 168
169 169 $ hg rebase -s 5 -d 4
170 170 rebasing 5:24b6387c8c8c "F"
171 171 rebasing 6:eea13746799a "G"
172 172 note: rebase of 6:eea13746799a created no changes to commit
173 173 rebasing 7:02de42196ebe "H" (tip)
174 174 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/24b6387c8c8c-c3fe765d-rebase.hg
175 175
176 176 $ hg tglog
177 177 @ 6: e9240aeaa6ad 'H'
178 178 |
179 179 o 5: 5d0ccadb6e3e 'F'
180 180 |
181 181 o 4: 9520eea781bc 'E'
182 182 |
183 183 | o 3: 32af7686d403 'D'
184 184 | |
185 185 | o 2: 5fddd98957c8 'C'
186 186 | |
187 187 | o 1: 42ccdea3bb16 'B'
188 188 |/
189 189 o 0: cd010b8cd998 'A'
190 190
191 191 $ cd ..
192 192
193 193
194 194 G onto H - merged revision having a parent in ancestors of target:
195 195
196 196 $ hg clone -q -u . a a5
197 197 $ cd a5
198 198
199 199 $ hg rebase -s 6 -d 7
200 200 rebasing 6:eea13746799a "G"
201 201 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/eea13746799a-883828ed-rebase.hg
202 202
203 203 $ hg tglog
204 204 o 7: 397834907a90 'G'
205 205 |\
206 206 | @ 6: 02de42196ebe 'H'
207 207 | |
208 208 | o 5: 24b6387c8c8c 'F'
209 209 | |
210 210 o | 4: 9520eea781bc 'E'
211 211 |/
212 212 | o 3: 32af7686d403 'D'
213 213 | |
214 214 | o 2: 5fddd98957c8 'C'
215 215 | |
216 216 | o 1: 42ccdea3bb16 'B'
217 217 |/
218 218 o 0: cd010b8cd998 'A'
219 219
220 220 $ cd ..
221 221
222 222
223 223 F onto B - G maintains E as parent:
224 224
225 225 $ hg clone -q -u . a a6
226 226 $ cd a6
227 227
228 228 $ hg rebase -s 5 -d 1
229 229 rebasing 5:24b6387c8c8c "F"
230 230 rebasing 6:eea13746799a "G"
231 231 rebasing 7:02de42196ebe "H" (tip)
232 232 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/24b6387c8c8c-c3fe765d-rebase.hg
233 233
234 234 $ hg tglog
235 235 @ 7: c87be72f9641 'H'
236 236 |
237 237 | o 6: 17badd73d4f1 'G'
238 238 |/|
239 239 o | 5: 74fb9ed646c4 'F'
240 240 | |
241 241 | o 4: 9520eea781bc 'E'
242 242 | |
243 243 | | o 3: 32af7686d403 'D'
244 244 | | |
245 245 +---o 2: 5fddd98957c8 'C'
246 246 | |
247 247 o | 1: 42ccdea3bb16 'B'
248 248 |/
249 249 o 0: cd010b8cd998 'A'
250 250
251 251 $ cd ..
252 252
253 253
254 254 These will fail (using --source):
255 255
256 256 G onto F - rebase onto an ancestor:
257 257
258 258 $ hg clone -q -u . a a7
259 259 $ cd a7
260 260
261 261 $ hg rebase -s 6 -d 5
262 262 nothing to rebase
263 263 [1]
264 264
265 265 F onto G - rebase onto a descendant:
266 266
267 267 $ hg rebase -s 5 -d 6
268 268 abort: source and destination form a cycle
269 269 [255]
270 270
271 271 G onto B - merge revision with both parents not in ancestors of target:
272 272
273 273 $ hg rebase -s 6 -d 1
274 274 rebasing 6:eea13746799a "G"
275 275 abort: cannot rebase 6:eea13746799a without moving at least one of its parents
276 276 [255]
277 277 $ hg rebase --abort
278 278 rebase aborted
279 279
280 280 These will abort gracefully (using --base):
281 281
282 282 G onto G - rebase onto same changeset:
283 283
284 284 $ hg rebase -b 6 -d 6
285 285 nothing to rebase - eea13746799a is both "base" and destination
286 286 [1]
287 287
288 288 G onto F - rebase onto an ancestor:
289 289
290 290 $ hg rebase -b 6 -d 5
291 291 nothing to rebase
292 292 [1]
293 293
294 294 F onto G - rebase onto a descendant:
295 295
296 296 $ hg rebase -b 5 -d 6
297 297 nothing to rebase - "base" 24b6387c8c8c is already an ancestor of destination eea13746799a
298 298 [1]
299 299
300 300 C onto A - rebase onto an ancestor:
301 301
302 302 $ hg rebase -d 0 -s 2
303 303 rebasing 2:5fddd98957c8 "C"
304 304 rebasing 3:32af7686d403 "D"
305 305 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg
306 306 $ hg tglog
307 307 o 7: c9659aac0000 'D'
308 308 |
309 309 o 6: e1c4361dd923 'C'
310 310 |
311 311 | @ 5: 02de42196ebe 'H'
312 312 | |
313 313 | | o 4: eea13746799a 'G'
314 314 | |/|
315 315 | o | 3: 24b6387c8c8c 'F'
316 316 |/ /
317 317 | o 2: 9520eea781bc 'E'
318 318 |/
319 319 | o 1: 42ccdea3bb16 'B'
320 320 |/
321 321 o 0: cd010b8cd998 'A'
322 322
323 323
324 324 Check rebasing public changeset
325 325
326 326 $ hg pull --config phases.publish=True -q -r 6 . # update phase of 6
327 327 $ hg rebase -d 0 -b 6
328 328 nothing to rebase
329 329 [1]
330 330 $ hg rebase -d 5 -b 6
331 331 abort: can't rebase public changeset e1c4361dd923
332 332 (see 'hg help phases' for details)
333 333 [255]
334 334 $ hg rebase -d 5 -r '1 + (6::)'
335 335 abort: can't rebase public changeset e1c4361dd923
336 336 (see 'hg help phases' for details)
337 337 [255]
338 338
339 339 $ hg rebase -d 5 -b 6 --keep
340 340 rebasing 6:e1c4361dd923 "C"
341 341 rebasing 7:c9659aac0000 "D" (tip)
342 342
343 343 Check rebasing mutable changeset
344 344 Source phase greater or equal to destination phase: new changeset get the phase of source:
345 345 $ hg id -n
346 346 5
347 347 $ hg rebase -s9 -d0
348 348 rebasing 9:2b23e52411f4 "D" (tip)
349 349 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2b23e52411f4-f942decf-rebase.hg
350 350 $ hg id -n # check we updated back to parent
351 351 5
352 352 $ hg log --template "{phase}\n" -r 9
353 353 draft
354 354 $ hg rebase -s9 -d1
355 355 rebasing 9:2cb10d0cfc6c "D" (tip)
356 356 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2cb10d0cfc6c-ddb0f256-rebase.hg
357 357 $ hg log --template "{phase}\n" -r 9
358 358 draft
359 359 $ hg phase --force --secret 9
360 360 $ hg rebase -s9 -d0
361 361 rebasing 9:c5b12b67163a "D" (tip)
362 362 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/c5b12b67163a-4e372053-rebase.hg
363 363 $ hg log --template "{phase}\n" -r 9
364 364 secret
365 365 $ hg rebase -s9 -d1
366 366 rebasing 9:2a0524f868ac "D" (tip)
367 367 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2a0524f868ac-cefd8574-rebase.hg
368 368 $ hg log --template "{phase}\n" -r 9
369 369 secret
370 370 Source phase lower than destination phase: new changeset get the phase of destination:
371 371 $ hg rebase -s8 -d9
372 372 rebasing 8:6d4f22462821 "C"
373 373 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6d4f22462821-3441f70b-rebase.hg
374 374 $ hg log --template "{phase}\n" -r 'rev(9)'
375 375 secret
376 376
377 377 $ cd ..
378 378
379 379 Check that temporary bundle doesn't lose phase when not using generaldelta
380 380
381 381 $ hg --config format.usegeneraldelta=no init issue5678
382 382 $ cd issue5678
383 383 $ grep generaldelta .hg/requires
384 384 [1]
385 385 $ echo a > a
386 386 $ hg ci -Aqm a
387 387 $ echo b > b
388 388 $ hg ci -Aqm b
389 389 $ hg co -q '.^'
390 390 $ echo c > c
391 391 $ hg ci -Aqm c
392 392 $ hg phase --public
393 393 $ hg log -G -T '{rev}:{node|shortest} {phase} {desc}\n'
394 394 @ 2:d36c public c
395 395 |
396 396 | o 1:d2ae draft b
397 397 |/
398 398 o 0:cb9a public a
399 399
400 400 $ hg rebase -s 1 -d 2
401 401 rebasing 1:d2ae7f538514 "b"
402 402 saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/d2ae7f538514-2953539b-rebase.hg
403 403 $ hg log -G -T '{rev}:{node|shortest} {phase} {desc}\n'
404 404 o 2:c882 draft b
405 405 |
406 406 @ 1:d36c public c
407 407 |
408 408 o 0:cb9a public a
409 409
410 410 $ cd ..
411 411
412 412 Test for revset
413 413
414 414 We need a bit different graph
415 415 All destination are B
416 416
417 417 $ hg init ah
418 418 $ cd ah
419 419 $ hg unbundle "$TESTDIR/bundles/rebase-revset.hg"
420 420 adding changesets
421 421 adding manifests
422 422 adding file changes
423 423 added 9 changesets with 9 changes to 9 files (+2 heads)
424 424 new changesets 9ae2ed22e576:479ddb54a924
425 425 (run 'hg heads' to see heads, 'hg merge' to merge)
426 426 $ hg tglog
427 427 o 8: 479ddb54a924 'I'
428 428 |
429 429 o 7: 72434a4e60b0 'H'
430 430 |
431 431 o 6: 3d8a618087a7 'G'
432 432 |
433 433 | o 5: 41bfcc75ed73 'F'
434 434 | |
435 435 | o 4: c01897464e7f 'E'
436 436 |/
437 437 o 3: ffd453c31098 'D'
438 438 |
439 439 o 2: c9e50f6cdc55 'C'
440 440 |
441 441 | o 1: 8fd0f7e49f53 'B'
442 442 |/
443 443 o 0: 9ae2ed22e576 'A'
444 444
445 445 $ cd ..
446 446
447 447
448 448 Simple case with keep:
449 449
450 450 Source on have two descendant heads but ask for one
451 451
452 452 $ hg clone -q -u . ah ah1
453 453 $ cd ah1
454 454 $ hg rebase -r '2::8' -d 1
455 455 abort: can't remove original changesets with unrebased descendants
456 456 (use --keep to keep original changesets)
457 457 [255]
458 458 $ hg rebase -r '2::8' -d 1 -k
459 459 rebasing 2:c9e50f6cdc55 "C"
460 460 rebasing 3:ffd453c31098 "D"
461 461 rebasing 6:3d8a618087a7 "G"
462 462 rebasing 7:72434a4e60b0 "H"
463 463 rebasing 8:479ddb54a924 "I" (tip)
464 464 $ hg tglog
465 465 o 13: 9bf1d9358a90 'I'
466 466 |
467 467 o 12: 274623a778d4 'H'
468 468 |
469 469 o 11: ab8c8617c8e8 'G'
470 470 |
471 471 o 10: c8cbf59f70da 'D'
472 472 |
473 473 o 9: 563e4faab485 'C'
474 474 |
475 475 | o 8: 479ddb54a924 'I'
476 476 | |
477 477 | o 7: 72434a4e60b0 'H'
478 478 | |
479 479 | o 6: 3d8a618087a7 'G'
480 480 | |
481 481 | | o 5: 41bfcc75ed73 'F'
482 482 | | |
483 483 | | o 4: c01897464e7f 'E'
484 484 | |/
485 485 | o 3: ffd453c31098 'D'
486 486 | |
487 487 | o 2: c9e50f6cdc55 'C'
488 488 | |
489 489 o | 1: 8fd0f7e49f53 'B'
490 490 |/
491 491 o 0: 9ae2ed22e576 'A'
492 492
493 493
494 494 $ cd ..
495 495
496 496 Base on have one descendant heads we ask for but common ancestor have two
497 497
498 498 $ hg clone -q -u . ah ah2
499 499 $ cd ah2
500 500 $ hg rebase -r '3::8' -d 1
501 501 abort: can't remove original changesets with unrebased descendants
502 502 (use --keep to keep original changesets)
503 503 [255]
504 504 $ hg rebase -r '3::8' -d 1 --keep
505 505 rebasing 3:ffd453c31098 "D"
506 506 rebasing 6:3d8a618087a7 "G"
507 507 rebasing 7:72434a4e60b0 "H"
508 508 rebasing 8:479ddb54a924 "I" (tip)
509 509 $ hg tglog
510 510 o 12: 9d7da0053b1c 'I'
511 511 |
512 512 o 11: 8fbd00952cbc 'H'
513 513 |
514 514 o 10: 51d434a615ee 'G'
515 515 |
516 516 o 9: a9c125634b0b 'D'
517 517 |
518 518 | o 8: 479ddb54a924 'I'
519 519 | |
520 520 | o 7: 72434a4e60b0 'H'
521 521 | |
522 522 | o 6: 3d8a618087a7 'G'
523 523 | |
524 524 | | o 5: 41bfcc75ed73 'F'
525 525 | | |
526 526 | | o 4: c01897464e7f 'E'
527 527 | |/
528 528 | o 3: ffd453c31098 'D'
529 529 | |
530 530 | o 2: c9e50f6cdc55 'C'
531 531 | |
532 532 o | 1: 8fd0f7e49f53 'B'
533 533 |/
534 534 o 0: 9ae2ed22e576 'A'
535 535
536 536
537 537 $ cd ..
538 538
539 539 rebase subset
540 540
541 541 $ hg clone -q -u . ah ah3
542 542 $ cd ah3
543 543 $ hg rebase -r '3::7' -d 1
544 544 abort: can't remove original changesets with unrebased descendants
545 545 (use --keep to keep original changesets)
546 546 [255]
547 547 $ hg rebase -r '3::7' -d 1 --keep
548 548 rebasing 3:ffd453c31098 "D"
549 549 rebasing 6:3d8a618087a7 "G"
550 550 rebasing 7:72434a4e60b0 "H"
551 551 $ hg tglog
552 552 o 11: 8fbd00952cbc 'H'
553 553 |
554 554 o 10: 51d434a615ee 'G'
555 555 |
556 556 o 9: a9c125634b0b 'D'
557 557 |
558 558 | o 8: 479ddb54a924 'I'
559 559 | |
560 560 | o 7: 72434a4e60b0 'H'
561 561 | |
562 562 | o 6: 3d8a618087a7 'G'
563 563 | |
564 564 | | o 5: 41bfcc75ed73 'F'
565 565 | | |
566 566 | | o 4: c01897464e7f 'E'
567 567 | |/
568 568 | o 3: ffd453c31098 'D'
569 569 | |
570 570 | o 2: c9e50f6cdc55 'C'
571 571 | |
572 572 o | 1: 8fd0f7e49f53 'B'
573 573 |/
574 574 o 0: 9ae2ed22e576 'A'
575 575
576 576
577 577 $ cd ..
578 578
579 579 rebase subset with multiple head
580 580
581 581 $ hg clone -q -u . ah ah4
582 582 $ cd ah4
583 583 $ hg rebase -r '3::(7+5)' -d 1
584 584 abort: can't remove original changesets with unrebased descendants
585 585 (use --keep to keep original changesets)
586 586 [255]
587 587 $ hg rebase -r '3::(7+5)' -d 1 --keep
588 588 rebasing 3:ffd453c31098 "D"
589 589 rebasing 4:c01897464e7f "E"
590 590 rebasing 5:41bfcc75ed73 "F"
591 591 rebasing 6:3d8a618087a7 "G"
592 592 rebasing 7:72434a4e60b0 "H"
593 593 $ hg tglog
594 594 o 13: 8fbd00952cbc 'H'
595 595 |
596 596 o 12: 51d434a615ee 'G'
597 597 |
598 598 | o 11: df23d8bda0b7 'F'
599 599 | |
600 600 | o 10: 47b7889448ff 'E'
601 601 |/
602 602 o 9: a9c125634b0b 'D'
603 603 |
604 604 | o 8: 479ddb54a924 'I'
605 605 | |
606 606 | o 7: 72434a4e60b0 'H'
607 607 | |
608 608 | o 6: 3d8a618087a7 'G'
609 609 | |
610 610 | | o 5: 41bfcc75ed73 'F'
611 611 | | |
612 612 | | o 4: c01897464e7f 'E'
613 613 | |/
614 614 | o 3: ffd453c31098 'D'
615 615 | |
616 616 | o 2: c9e50f6cdc55 'C'
617 617 | |
618 618 o | 1: 8fd0f7e49f53 'B'
619 619 |/
620 620 o 0: 9ae2ed22e576 'A'
621 621
622 622
623 623 $ cd ..
624 624
625 625 More advanced tests
626 626
627 627 rebase on ancestor with revset
628 628
629 629 $ hg clone -q -u . ah ah5
630 630 $ cd ah5
631 631 $ hg rebase -r '6::' -d 2
632 632 rebasing 6:3d8a618087a7 "G"
633 633 rebasing 7:72434a4e60b0 "H"
634 634 rebasing 8:479ddb54a924 "I" (tip)
635 635 saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-b4f73f31-rebase.hg
636 636 $ hg tglog
637 637 o 8: fcb52e68a694 'I'
638 638 |
639 639 o 7: 77bd65cd7600 'H'
640 640 |
641 641 o 6: 12d0e738fb18 'G'
642 642 |
643 643 | o 5: 41bfcc75ed73 'F'
644 644 | |
645 645 | o 4: c01897464e7f 'E'
646 646 | |
647 647 | o 3: ffd453c31098 'D'
648 648 |/
649 649 o 2: c9e50f6cdc55 'C'
650 650 |
651 651 | o 1: 8fd0f7e49f53 'B'
652 652 |/
653 653 o 0: 9ae2ed22e576 'A'
654 654
655 655 $ cd ..
656 656
657 657
658 658 rebase with multiple root.
659 659 We rebase E and G on B
660 660 We would expect heads are I, F if it was supported
661 661
662 662 $ hg clone -q -u . ah ah6
663 663 $ cd ah6
664 664 $ hg rebase -r '(4+6)::' -d 1
665 665 rebasing 4:c01897464e7f "E"
666 666 rebasing 5:41bfcc75ed73 "F"
667 667 rebasing 6:3d8a618087a7 "G"
668 668 rebasing 7:72434a4e60b0 "H"
669 669 rebasing 8:479ddb54a924 "I" (tip)
670 670 saved backup bundle to $TESTTMP/ah6/.hg/strip-backup/3d8a618087a7-aae93a24-rebase.hg
671 671 $ hg tglog
672 672 o 8: 9136df9a87cf 'I'
673 673 |
674 674 o 7: 23e8f30da832 'H'
675 675 |
676 676 o 6: b0efe8534e8b 'G'
677 677 |
678 678 | o 5: 6eb5b496ab79 'F'
679 679 | |
680 680 | o 4: d15eade9b0b1 'E'
681 681 |/
682 682 | o 3: ffd453c31098 'D'
683 683 | |
684 684 | o 2: c9e50f6cdc55 'C'
685 685 | |
686 686 o | 1: 8fd0f7e49f53 'B'
687 687 |/
688 688 o 0: 9ae2ed22e576 'A'
689 689
690 690 $ cd ..
691 691
692 692 More complex rebase with multiple roots
693 693 each root have a different common ancestor with the destination and this is a detach
694 694
695 695 (setup)
696 696
697 697 $ hg clone -q -u . a a8
698 698 $ cd a8
699 699 $ echo I > I
700 700 $ hg add I
701 701 $ hg commit -m I
702 702 $ hg up 4
703 703 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
704 704 $ echo I > J
705 705 $ hg add J
706 706 $ hg commit -m J
707 707 created new head
708 708 $ echo I > K
709 709 $ hg add K
710 710 $ hg commit -m K
711 711 $ hg tglog
712 712 @ 10: 23a4ace37988 'K'
713 713 |
714 714 o 9: 1301922eeb0c 'J'
715 715 |
716 716 | o 8: e7ec4e813ba6 'I'
717 717 | |
718 718 | o 7: 02de42196ebe 'H'
719 719 | |
720 720 +---o 6: eea13746799a 'G'
721 721 | |/
722 722 | o 5: 24b6387c8c8c 'F'
723 723 | |
724 724 o | 4: 9520eea781bc 'E'
725 725 |/
726 726 | o 3: 32af7686d403 'D'
727 727 | |
728 728 | o 2: 5fddd98957c8 'C'
729 729 | |
730 730 | o 1: 42ccdea3bb16 'B'
731 731 |/
732 732 o 0: cd010b8cd998 'A'
733 733
734 734 (actual test)
735 735
736 736 $ hg rebase --dest 'desc(G)' --rev 'desc(K) + desc(I)'
737 737 rebasing 8:e7ec4e813ba6 "I"
738 738 rebasing 10:23a4ace37988 "K" (tip)
739 739 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/23a4ace37988-b06984b3-rebase.hg
740 740 $ hg log --rev 'children(desc(G))'
741 741 changeset: 9:adb617877056
742 742 parent: 6:eea13746799a
743 743 user: test
744 744 date: Thu Jan 01 00:00:00 1970 +0000
745 745 summary: I
746 746
747 747 changeset: 10:882431a34a0e
748 748 tag: tip
749 749 parent: 6:eea13746799a
750 750 user: test
751 751 date: Thu Jan 01 00:00:00 1970 +0000
752 752 summary: K
753 753
754 754 $ hg tglog
755 755 @ 10: 882431a34a0e 'K'
756 756 |
757 757 | o 9: adb617877056 'I'
758 758 |/
759 759 | o 8: 1301922eeb0c 'J'
760 760 | |
761 761 | | o 7: 02de42196ebe 'H'
762 762 | | |
763 763 o---+ 6: eea13746799a 'G'
764 764 |/ /
765 765 | o 5: 24b6387c8c8c 'F'
766 766 | |
767 767 o | 4: 9520eea781bc 'E'
768 768 |/
769 769 | o 3: 32af7686d403 'D'
770 770 | |
771 771 | o 2: 5fddd98957c8 'C'
772 772 | |
773 773 | o 1: 42ccdea3bb16 'B'
774 774 |/
775 775 o 0: cd010b8cd998 'A'
776 776
777 777
778 778 Test that rebase is not confused by $CWD disappearing during rebase (issue4121)
779 779
780 780 $ cd ..
781 781 $ hg init cwd-vanish
782 782 $ cd cwd-vanish
783 783 $ touch initial-file
784 784 $ hg add initial-file
785 785 $ hg commit -m 'initial commit'
786 786 $ touch dest-file
787 787 $ hg add dest-file
788 788 $ hg commit -m 'dest commit'
789 789 $ hg up 0
790 790 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
791 791 $ touch other-file
792 792 $ hg add other-file
793 793 $ hg commit -m 'first source commit'
794 794 created new head
795 795 $ mkdir subdir
796 796 $ cd subdir
797 797 $ touch subfile
798 798 $ hg add subfile
799 799 $ hg commit -m 'second source with subdir'
800 800
801 801 $ hg rebase -b . -d 1 --traceback
802 802 rebasing 2:779a07b1b7a0 "first source commit"
803 803 current directory was removed (rmcwd !)
804 804 (consider changing to repo root: $TESTTMP/cwd-vanish) (rmcwd !)
805 805 rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip)
806 806 saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-rebase.hg
807 807
808 808 Get back to the root of cwd-vanish. Note that even though `cd ..`
809 809 works on most systems, it does not work on FreeBSD 10, so we use an
810 810 absolute path to get back to the repository.
811 811 $ cd $TESTTMP
812 812
813 813 Test that rebase is done in topo order (issue5370)
814 814
815 815 $ hg init order
816 816 $ cd order
817 817 $ touch a && hg add a && hg ci -m A
818 818 $ touch b && hg add b && hg ci -m B
819 819 $ touch c && hg add c && hg ci -m C
820 820 $ hg up 1
821 821 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
822 822 $ touch d && hg add d && hg ci -m D
823 823 created new head
824 824 $ hg up 2
825 825 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
826 826 $ touch e && hg add e && hg ci -m E
827 827 $ hg up 3
828 828 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
829 829 $ touch f && hg add f && hg ci -m F
830 830 $ hg up 0
831 831 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
832 832 $ touch g && hg add g && hg ci -m G
833 833 created new head
834 834
835 835 $ hg tglog
836 836 @ 6: 124bb27b6f28 'G'
837 837 |
838 838 | o 5: 412b391de760 'F'
839 839 | |
840 840 | | o 4: 82ae8dc7a9b7 'E'
841 841 | | |
842 842 | o | 3: ab709c9f7171 'D'
843 843 | | |
844 844 | | o 2: d84f5cfaaf14 'C'
845 845 | |/
846 846 | o 1: 76035bbd54bd 'B'
847 847 |/
848 848 o 0: 216878401574 'A'
849 849
850 850
851 851 $ hg rebase -s 1 -d 6
852 852 rebasing 1:76035bbd54bd "B"
853 853 rebasing 2:d84f5cfaaf14 "C"
854 854 rebasing 4:82ae8dc7a9b7 "E"
855 855 rebasing 3:ab709c9f7171 "D"
856 856 rebasing 5:412b391de760 "F"
857 857 saved backup bundle to $TESTTMP/order/.hg/strip-backup/76035bbd54bd-e341bc99-rebase.hg
858 858
859 859 $ hg tglog
860 860 o 6: 31884cfb735e 'F'
861 861 |
862 862 o 5: 6d89fa5b0909 'D'
863 863 |
864 864 | o 4: de64d97c697b 'E'
865 865 | |
866 866 | o 3: b18e4d2d0aa1 'C'
867 867 |/
868 868 o 2: 0983daf9ff6a 'B'
869 869 |
870 870 @ 1: 124bb27b6f28 'G'
871 871 |
872 872 o 0: 216878401574 'A'
873 873
874 874
875 875 Test experimental revset
876 876 ========================
877 877
878 878 $ cd ../cwd-vanish
879 879
880 880 Make the repo a bit more interesting
881 881
882 882 $ hg up 1
883 883 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
884 884 $ echo aaa > aaa
885 885 $ hg add aaa
886 886 $ hg commit -m aaa
887 887 created new head
888 888 $ hg log -G
889 889 @ changeset: 4:5f7bc9025ed2
890 890 | tag: tip
891 891 | parent: 1:58d79cc1cf43
892 892 | user: test
893 893 | date: Thu Jan 01 00:00:00 1970 +0000
894 894 | summary: aaa
895 895 |
896 896 | o changeset: 3:1910d5ff34ea
897 897 | | user: test
898 898 | | date: Thu Jan 01 00:00:00 1970 +0000
899 899 | | summary: second source with subdir
900 900 | |
901 901 | o changeset: 2:82901330b6ef
902 902 |/ user: test
903 903 | date: Thu Jan 01 00:00:00 1970 +0000
904 904 | summary: first source commit
905 905 |
906 906 o changeset: 1:58d79cc1cf43
907 907 | user: test
908 908 | date: Thu Jan 01 00:00:00 1970 +0000
909 909 | summary: dest commit
910 910 |
911 911 o changeset: 0:e94b687f7da3
912 912 user: test
913 913 date: Thu Jan 01 00:00:00 1970 +0000
914 914 summary: initial commit
915 915
916 916
917 917 Testing from lower head
918 918
919 919 $ hg up 3
920 920 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
921 921 $ hg log -r '_destrebase()'
922 922 changeset: 4:5f7bc9025ed2
923 923 tag: tip
924 924 parent: 1:58d79cc1cf43
925 925 user: test
926 926 date: Thu Jan 01 00:00:00 1970 +0000
927 927 summary: aaa
928 928
929 929
930 930 Testing from upper head
931 931
932 932 $ hg log -r '_destrebase(4)'
933 933 changeset: 3:1910d5ff34ea
934 934 user: test
935 935 date: Thu Jan 01 00:00:00 1970 +0000
936 936 summary: second source with subdir
937 937
938 938 $ hg up 4
939 939 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
940 940 $ hg log -r '_destrebase()'
941 941 changeset: 3:1910d5ff34ea
942 942 user: test
943 943 date: Thu Jan 01 00:00:00 1970 +0000
944 944 summary: second source with subdir
945 945
946 946 Testing rebase being called inside another transaction
947 947
948 948 $ cd $TESTTMP
949 949 $ hg init tr-state
950 950 $ cd tr-state
951 951 $ cat > $TESTTMP/wraprebase.py <<EOF
952 952 > from __future__ import absolute_import
953 953 > from mercurial import extensions
954 954 > def _rebase(orig, ui, repo, *args, **kwargs):
955 955 > with repo.wlock():
956 956 > with repo.lock():
957 > with repo.transaction('wrappedrebase'):
957 > with repo.transaction(b'wrappedrebase'):
958 958 > return orig(ui, repo, *args, **kwargs)
959 959 > def wraprebase(loaded):
960 960 > assert loaded
961 > rebasemod = extensions.find('rebase')
962 > extensions.wrapcommand(rebasemod.cmdtable, 'rebase', _rebase)
961 > rebasemod = extensions.find(b'rebase')
962 > extensions.wrapcommand(rebasemod.cmdtable, b'rebase', _rebase)
963 963 > def extsetup(ui):
964 > extensions.afterloaded('rebase', wraprebase)
964 > extensions.afterloaded(b'rebase', wraprebase)
965 965 > EOF
966 966
967 967 $ cat >> .hg/hgrc <<EOF
968 968 > [extensions]
969 969 > wraprebase=$TESTTMP/wraprebase.py
970 970 > [experimental]
971 971 > evolution=true
972 972 > EOF
973 973
974 974 $ hg debugdrawdag <<'EOS'
975 975 > B C
976 976 > |/
977 977 > A
978 978 > EOS
979 979
980 980 $ hg rebase -s C -d B
981 981 rebasing 2:dc0947a82db8 "C" (C tip)
982 982
983 983 $ [ -f .hg/rebasestate ] && echo 'WRONG: rebasestate should not exist'
984 984 [1]
General Comments 0
You need to be logged in to leave comments. Login now