Here is the script that helps reproducing the problem. Notice that it needs fossil fixed by the patch I proposed in [c9d454153e], otherwise it fails to reproduce the problem (not that it works; simply it misses commits when merging):

<verbatim>
fossil new a.fossil
mkdir a
cd a
fossil open ../a.fossil
touch b
fossil add b
sleep 1
fossil commit -b b -m xxxb
fossil update trunk
touch a
fossil add a
sleep 1
fossil commit -m xxxa
fossil mv a c
mv a c
sleep 1
fossil commit -m xxxac
fossil update b
fossil merge trunk
sleep 1
fossil commit -m merge
fossil update trunk
</verbatim>

After this:
<verbatim>
$ fossil merge b
ADDED b
ADDED d
DELETE c
"fossil undo" is available to undo changes to the working checkout.
</verbatim>

It should *not* delete C.

Notice that without the patch in [c9d454153e], <kbd>fossil merge</kbd> fails to see the rename at all, and will do the merge ignoring the checkin with the rename in trunk.