This is an archive of the discontinued Mercurial Phabricator instance.

rebase: show bug when rebasing merge with obsoleted revs on both sides
AbandonedPublic

Authored by durin42 on Feb 13 2020, 4:00 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

By inspection, the rebase should be fine: "just" omit 8 and 10 from
the rebase. This is a simplified case of something we're seeing at
Google.

DO NOT ACCEPT: this is being shared to try and get help figuring out
how to resolve the issue.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

durin42 created this revision.Feb 13 2020, 4:00 PM

We already have tests for this (grepping for "unwanted changes" in tests/ should be enough to find them).

It's not easy to omit revisions 8 and 10 from the rebase. The key is to realize that rebase is done by repeated grafting of diffs and that the diffs are always between two commits. We can therefore rebase revisions 9 and 11 without a problem (we take the diff from revisions 8 and 10, respectively). But when rebasing the merge commit, which diff do we graft? If we use 9 as base (i.e. we try to graft the diff between 9 and 12), we'll get unwanted changes from commit 10. Conversely, if we use 11 as base, we'll get unwanted changes from commit 8.

I have been thinking a bit about how to solve it by doing the rebase in smaller steps, but it's pretty complicated and maybe I should write it down in a plan page instead.

We already have tests for this (grepping for "unwanted changes" in tests/ should be enough to find them).
It's not easy to omit revisions 8 and 10 from the rebase. The key is to realize that rebase is done by repeated grafting of diffs and that the diffs are always between two commits. We can therefore rebase revisions 9 and 11 without a problem (we take the diff from revisions 8 and 10, respectively). But when rebasing the merge commit, which diff do we graft? If we use 9 as base (i.e. we try to graft the diff between 9 and 12), we'll get unwanted changes from commit 10. Conversely, if we use 11 as base, we'll get unwanted changes from commit 8.
I have been thinking a bit about how to solve it by doing the rebase in smaller steps, but it's pretty complicated and maybe I should write it down in a plan page instead.

looks like a legitimate need for 5 ways merge.

@durin42 can we get this revision out of yadda? It is not ready to land and we won't have a solution soon™

durin42 abandoned this revision.Mar 20 2020, 11:53 AM