diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -3140,6 +3140,7 @@ def debugrebuilddirstate(ui, repo, rev, changedfiles = manifestonly | dsnotadded dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles) + dirstate.write(repo.currenttransaction()) @command(