comparison mercurial/localrepo.py @ 49959:376395868b7b

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.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 13 Dec 2022 10:00:04 +0100
parents ff7134e03629
children e333cc169c45
comparison
equal deleted inserted replaced
49958:96e526fe5fb0 49959:376395868b7b
3071 if self._currentlock(self._lockref) is not None: 3071 if self._currentlock(self._lockref) is not None:
3072 self.ui.develwarn(b'"wlock" acquired after "lock"') 3072 self.ui.develwarn(b'"wlock" acquired after "lock"')
3073 3073
3074 def unlock(): 3074 def unlock():
3075 if self.dirstate.pendingparentchange(): 3075 if self.dirstate.pendingparentchange():
3076 msg = b"wlock release in the middle of a changing parents"
3077 self.ui.develwarn(msg)
3076 self.dirstate.invalidate() 3078 self.dirstate.invalidate()
3077 else: 3079 else:
3078 self.dirstate.write(None) 3080 self.dirstate.write(None)
3079 3081
3080 self._filecache[b'dirstate'].refresh() 3082 self._filecache[b'dirstate'].refresh()