diff -r e2b89b6d4cdd -r c5ef535e274e mercurial/context.py --- a/mercurial/context.py Thu Dec 15 02:54:06 2022 +0100 +++ b/mercurial/context.py Wed Feb 15 23:28:20 2023 +0100 @@ -1875,12 +1875,16 @@ normal = dirstate.set_clean for f, pdf in fixup: normal(f, pdf) - # write changes out explicitly, because nesting - # wlock at runtime may prevent 'wlock.release()' - # after this block from doing so for subsequent - # changing files - tr = self._repo.currenttransaction() - self._repo.dirstate.write(tr) + # write changes out explicitly, because nesting + # wlock at runtime may prevent 'wlock.release()' + # after this block from doing so for subsequent + # changing files + # + # (This is outside of the (if fixup) block because the + # status operation itself might have updated some cache + # information before.) + tr = self._repo.currenttransaction() + self._repo.dirstate.write(tr) if poststatus: for ps in poststatus: