This is an archive of the discontinued Mercurial Phabricator instance.

tests: add test of rebase with conflict in merge commit
ClosedPublic

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

Details

Summary

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

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Jan 11 2020, 1:47 AM
pulkit added a subscriber: pulkit.Jan 13 2020, 7:48 AM
pulkit added inline comments.
tests/test-rebase-conflicts.t
460

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.Jan 13 2020, 1:16 PM
tests/test-rebase-conflicts.t
460

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).

martinvonz updated this revision to Diff 19859.Feb 3 2020, 1:08 PM
martinvonz marked an inline comment as done.Feb 3 2020, 1:09 PM
martinvonz added inline comments.
tests/test-rebase-conflicts.t
460

I've updated the comment to not be opinionated. I hope we can now queue this patch (and a few more in this series) regardless of what we think of D7827.

durin42 accepted this revision.Feb 10 2020, 9:15 PM
This revision is now accepted and ready to land.Feb 10 2020, 9:15 PM