diff -r edcc35a4f1dc -r 9fc0d244a753 mercurial/localrepo.py --- a/mercurial/localrepo.py Tue Mar 14 14:08:38 2023 +0000 +++ b/mercurial/localrepo.py Wed Mar 15 05:49:56 2023 +0100 @@ -2951,6 +2951,7 @@ known good state).""" unfi = self.unfiltered() if 'dirstate' in unfi.__dict__: + assert not self.dirstate.is_changing_any del unfi.__dict__['dirstate'] def invalidate(self, clearfilecache=False):