changeset 50057:cf8b9c80d67c

dirstate: issue a developer warning on implicit write on wlock release Our goal is to get rid of all these to clarify the writing pattern, so it is time to warn about this (and later, forbid it).
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 13 Dec 2022 09:59:22 +0100
parents 1f369ca9e34c
children d1215f905818
files mercurial/localrepo.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed Feb 15 23:29:04 2023 +0100
+++ b/mercurial/localrepo.py	Tue Dec 13 09:59:22 2022 +0100
@@ -3075,6 +3075,9 @@
                 self.ui.develwarn(msg)
                 self.dirstate.invalidate()
             else:
+                if self.dirstate._dirty:
+                    msg = b"dirty dirstate on wlock release"
+                    self.ui.develwarn(msg)
                 self.dirstate.write(None)
 
             self._filecache[b'dirstate'].refresh()