Until now, merge.update() didn't mark copies in the
overlayworkingctx (when using that). That's because we copies are
recorded in the wctx (whether that's a workingctx or a
overlayworkingctx) in recordupdates(), which is not called when we
should not udpate the dirstate, which we should not do for in-memory
updates.
We had not noticed this before because rebase calls graftcopies
after. However, I think that using merge.update() with an in-memory
context outside the context of rebase would lose copies.
This patch fixes the problem by first extracting the desired copies
from the action map and then applying the changes outside of
recordupdates() (and removing the copy-marking from that method).
An alternative solution would be to call recordupdates() also in the
in-memory case by modifying it to call wctx.drop() etc (which don't
yet exist), but that would mean that we would add a bunch of no-op
methods on overlayworkingctx, since that already knows which files
are tracked.
I don't understand this docstring. From what I see of the code, it mostly pull things from an actions dictionnary to put them in a copies dictionnary. That does not seems to involves the dirstates nor any "recording". Am I missing something ?