comparison tests/test-rebase-obsolete.t @ 33678:855a1856466d

tests: demonstrate crash when trying to rebase merge without its parents As the test case shows, when "hg rebase -d G -r 'B + D + F'" is run on the following graph, we crash with traceback. It's reasonable to fail because we can not easily produce a correct rebased F. The problem is what diff to apply to either the rebased B or the rebased D. We could potentially produce the result by e.g. applying the (F-D) diff to the rebased B and then applying the reverse (E-D) diff on top, but that could result in merge conflicts in each of those steps, which we don't have a way of dealing with. So for now, let's just add a test case to demonstrate that we crash (i.e. the AssertionError is clearly incorrect since the user can run into it). F /| C E | | B D G \|/ A Differential Revision: https://phab.mercurial-scm.org/D212
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 14 Jul 2017 14:30:55 -0700
parents 644dddccc265
children 2194a8723138
comparison
equal deleted inserted replaced
33677:644dddccc265 33678:855a1856466d
469 | | 469 | |
470 o | 4:9520eea781bc E 470 o | 4:9520eea781bc E
471 |/ 471 |/
472 o 0:cd010b8cd998 A 472 o 0:cd010b8cd998 A
473 473
474 $ cd ..
475
476 Detach both parents
477
478 $ hg init double-detach
479 $ cd double-detach
480
481 $ hg debugdrawdag <<EOF
482 > F
483 > /|
484 > C E
485 > | |
486 > B D G
487 > \|/
488 > A
489 > EOF
490
491 BROKEN: This raises an exception
492 $ hg rebase -d G -r 'B + D + F' 2>&1 | grep '^AssertionError'
493 AssertionError: no base found to rebase on (defineparents called wrong)
494
474 $ cd .. 495 $ cd ..
475 496
476 test on rebase dropping a merge 497 test on rebase dropping a merge
477 498
478 (setup) 499 (setup)