Before 0ecb3b11fcad, wctx._compact(), was called by wctx.nofilechanges() as
a side effect. Later, it turned out that this side effect is needed to correctly
detect which files changed. See https://phab.mercurial-scm.org/D8733#131949 for
the history.
The problem could also be triggered by running tests/test-rebase-parameters.t
with --extra-config-opt rebase.experimental.inmemory=1.
Reminder to do this :) Do you have a planned fix? Sorry if there is one that I just haven't seen (or forgotten).
(I just happened to notice this comment while looking at the rebase code today.)