With in-memory merge, copy information needs to be stored in-memory, not in the
dirstate.
To make this transition easy, move the existing dirstate-based approach to
workingfilectx; that way, other implementations can choose to store it
somewhere else.
I would probably have put this on workingctx instead (not per file). It feels like it better matches how copies are recorded in the dirstate (which is not per file). It looks like this would be a little simpler that way. Will future patches be simpler by doing it on the workingfilectx instead?