comparison tests/test-rebase-interruptions.t @ 33332:3b7cb3d17137

rebase: use scmutil.cleanupnodes (issue5606) (BC) This patch migrates rebase to use scmutil.cleanupnodes API. It simplifies the code and makes rebase code reusable inside a transaction. This is a BC because the backup file is no longer strip-backup/*-backup.hg, but strip-backup/*-rebase.hg. The latter looks more reasonable since the directory name is "strip-backup" so there is no need to repeat "backup". I think the backup file name change is probably fine as a BC, since we have changed it before (aa4a1672583e) and didn't get complains. The end result of this series will be a much more consistent and unified backup names: command | old backup file suffix | new backup file suffix ------------------------------------------------------------------- amend | amend-backup.hg | amend.hg histedit | backup.hg (could be 2 files) | histedit.hg (single file) rebase | backup.hg | rebase.hg strip | backup.hg | backup.hg (note: backup files are under .hg/strip-backup) It also fixes issue5606 as a side effect because the new "delayedstrip" code path will carefully examine nodes (safestriproots) to make sure orphaned changesets won't get stripped by accident. Some warning messages are changed to the new "warning: orphaned descendants detected, not stripping HASHES", which provides more information about exactly what changesets are left behind. Another minor behavior change is when there is an obsoleted changeset with a successor in the destination branch, bookmarks pointing to that obsoleted changeset will not be moved. I have commented in test-rebase-obsolete.t explaining why that is more desirable.
author Jun Wu <quark@fb.com>
date Fri, 07 Jul 2017 18:51:46 -0700
parents 4b0da963586d
children 469b06b4c3ca
comparison
equal deleted inserted replaced
33331:4bae3c117b57 33332:3b7cb3d17137
110 continue: hg rebase --continue 110 continue: hg rebase --continue
111 111
112 $ hg rebase --continue 112 $ hg rebase --continue
113 already rebased 1:27547f69f254 "B" as 45396c49d53b 113 already rebased 1:27547f69f254 "B" as 45396c49d53b
114 rebasing 2:965c486023db "C" 114 rebasing 2:965c486023db "C"
115 warning: new changesets detected on source branch, not stripping 115 warning: orphaned descendants detected, not stripping 27547f69f254, 965c486023db
116 116
117 $ hg tglogp 117 $ hg tglogp
118 o 7:draft 'C' 118 o 7:draft 'C'
119 | 119 |
120 | o 6:secret 'Extra' 120 | o 6:secret 'Extra'
309 o 0:public 'A' 309 o 0:public 'A'
310 310
311 $ hg rebase --continue 311 $ hg rebase --continue
312 already rebased 2:965c486023db "C" as 401ccec5e39f 312 already rebased 2:965c486023db "C" as 401ccec5e39f
313 rebasing 6:a0b2430ebfb8 "F" 313 rebasing 6:a0b2430ebfb8 "F"
314 saved backup bundle to $TESTTMP/hook-precommit/.hg/strip-backup/965c486023db-aa6250e7-backup.hg (glob) 314 saved backup bundle to $TESTTMP/hook-precommit/.hg/strip-backup/965c486023db-aa6250e7-rebase.hg (glob)
315 $ hg tglogp 315 $ hg tglogp
316 @ 6:secret 'F' 316 @ 6:secret 'F'
317 | 317 |
318 o 5:secret 'C' 318 o 5:secret 'C'
319 | 319 |
364 o 0:public 'A' 364 o 0:public 'A'
365 365
366 $ hg rebase --continue 366 $ hg rebase --continue
367 already rebased 2:965c486023db "C" as 401ccec5e39f 367 already rebased 2:965c486023db "C" as 401ccec5e39f
368 rebasing 6:a0b2430ebfb8 "F" 368 rebasing 6:a0b2430ebfb8 "F"
369 saved backup bundle to $TESTTMP/hook-pretxncommit/.hg/strip-backup/965c486023db-aa6250e7-backup.hg (glob) 369 saved backup bundle to $TESTTMP/hook-pretxncommit/.hg/strip-backup/965c486023db-aa6250e7-rebase.hg (glob)
370 $ hg tglogp 370 $ hg tglogp
371 @ 6:secret 'F' 371 @ 6:secret 'F'
372 | 372 |
373 o 5:secret 'C' 373 o 5:secret 'C'
374 | 374 |
414 o 0:public 'A' 414 o 0:public 'A'
415 415
416 $ hg rebase --continue 416 $ hg rebase --continue
417 already rebased 2:965c486023db "C" as 401ccec5e39f 417 already rebased 2:965c486023db "C" as 401ccec5e39f
418 rebasing 6:a0b2430ebfb8 "F" 418 rebasing 6:a0b2430ebfb8 "F"
419 saved backup bundle to $TESTTMP/hook-pretxnclose/.hg/strip-backup/965c486023db-aa6250e7-backup.hg (glob) 419 saved backup bundle to $TESTTMP/hook-pretxnclose/.hg/strip-backup/965c486023db-aa6250e7-rebase.hg (glob)
420 $ hg tglogp 420 $ hg tglogp
421 @ 6:secret 'F' 421 @ 6:secret 'F'
422 | 422 |
423 o 5:secret 'C' 423 o 5:secret 'C'
424 | 424 |
457 (no more unresolved files) 457 (no more unresolved files)
458 continue: hg rebase --continue 458 continue: hg rebase --continue
459 $ hg rebase --continue 459 $ hg rebase --continue
460 rebasing 1:fdaca8533b86 "b" 460 rebasing 1:fdaca8533b86 "b"
461 note: rebase of 1:fdaca8533b86 created no changes to commit 461 note: rebase of 1:fdaca8533b86 created no changes to commit
462 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/fdaca8533b86-7fd70513-backup.hg (glob) 462 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/fdaca8533b86-7fd70513-rebase.hg (glob)
463 $ hg resolve --list 463 $ hg resolve --list
464 $ test -f .hg/merge 464 $ test -f .hg/merge
465 [1] 465 [1]