Rebase with obsoleted changesets in rebaseset
This page is intended for developer
This page collects situations and discussion about rebase where the rebaseset contains obsoleted changesets.
Situations
Successor is an ancestor of dest
Z E # E: unstable | | D' D # D: replaced by D' | | B C |/ A
rebase -s C -d Z can just skip D
E' | C' | Z | ~
Successor is also in a rebase set
This is probably the most interesting one.
E # E: unstable | Z D D' # D: replaced by D' | |/ B C |/ A
Option 1: rebase -s C -d Z creates new markers, avoid potential merge conflicts (in case the user knows there will be a conflict and wants to edit D"' before rebase E'). Strictly better than Option 4. Could be considered as the default behavior.
E' | D" D"' # D": replaced by D"' |/ C' / Z | ~
Option 2: rebase -s C -d Z auto rebases E' to D"', does not create D", and does not create new markers. Like running "hg evolve" after Option 1. Could be considered as the behavior when --evolve is set - see "Option 3" with "--evolve" below.
E' | D"' | C' / Z | ~
Option 3 (not ideal): rebase -s C -d Z aborts (current default behavior)
Option 4 (not ideal): rebase -s C -d Z creates divergence (current behavior with experimental.allowdivergence=1)
Successor is in other places
E # E: unstable | Z D' D # D: replaced by D' \| / B C |/ A
Option 1: rebase -s C -d Z aborts (current default behavior)
Option 2: rebase -s C -d Z creates diverange (with experimental.allowdivergence=True)
Option 3: rebase -s C -d Z --evolve rebases roots to destination and evolves others
C'E' | | Z D' \| B | A