Page MenuHomePhabricator

tests: add test of rebase with conflict in merge commit
Needs ReviewPublic

Authored by martinvonz on Sat, Jan 11, 1:47 AM.


Group Reviewers

It doesn't seem like we had any tests of this. I think it's pretty
weird that the two parents we're merging are not the working copy
parents during the conflict resolution.

Diff Detail

rHG Mercurial
No Linters Available
No Unit Test Coverage

Event Timeline

martinvonz created this revision.Sat, Jan 11, 1:47 AM
pulkit added a subscriber: pulkit.Mon, Jan 13, 7:48 AM
pulkit added inline comments.

I think it will be weird to have current parents as 7 and 8. Rebase copies commit, so if there is a merge commit, it copies it instead of recreating one. Also if we have 7 and 8 as parents, we might not have correct conflicts.

martinvonz added inline comments.Mon, Jan 13, 1:16 PM

I made more arguments for changing it in the next patch (D7827). See if those can convince you :)

I'm not sure what you mean about not having correct conflicts. Related to that, I think it's actually weird (with how it's currently done) how you would not see any changes made between the merge base and the rebase base. So if there had been commits between A and C here and we were rebasing from C, we would not see those changes in the working copy. That's of course correct, but the dirstate's two parents suggest, IMO, that we're merging the two commits, so we should see those changes.

I can see the value in having the thing you're grafting in as a working copy parent because it makes it appear in the hg log output as a reminder. However, I don't think that's what the purpose of the dirstate parent should be. We could perhaps add another mechanism for showing the commit that's being rebased, and maybe also the base (which is generally not the merge base).