dirstate: issue a developer warning on implicit write on wlock release
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 13 Dec 2022 09:59:22 +0100
changeset 50057 cf8b9c80d67c
parent 50056 1f369ca9e34c
child 50058 d1215f905818
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).
mercurial/localrepo.py
--- 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()