# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1670922004 -3600
#      Tue Dec 13 10:00:04 2022 +0100
# Node ID 376395868b7b96ba3549f833b2d7b3cba590325b
# Parent  96e526fe5fb0c900cbd198728a8e5636e36092ab
dirstate: warn about non-explicitly rolledback parent-change

Now that the invalidation is dealt with by the context manager itself, we
should no longer need this in the unlocking code. We start with issuing a
warning if this is the case before actually dropping this code later.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -3073,6 +3073,8 @@
 
         def unlock():
             if self.dirstate.pendingparentchange():
+                msg = b"wlock release in the middle of a changing parents"
+                self.ui.develwarn(msg)
                 self.dirstate.invalidate()
             else:
                 self.dirstate.write(None)