This is similar to past 20 patches or so where we are replacing use of a bare
actions dict with a dedicated mergeresult object. The goal is to have a
dedicated powerful object instead of a dict while making the code more easier to
understand.
In past few patches, we have already simplified the code at some places using
the newly introduced object.
This patch does not updates applyupdates() to use the mergeresult object
directly. That will be done in next patch to make things easier to review.
Shouldn't we be using the constant for r here? But this appeared in the old code, so not a new issue.