diff -r 9c668377aa9f -r 69c5f8d6c710 mercurial/localrepo.py --- a/mercurial/localrepo.py Wed Sep 06 18:23:32 2023 +0200 +++ b/mercurial/localrepo.py Wed Jun 12 11:29:11 2024 +0200 @@ -3122,6 +3122,7 @@ l.lock() return l + self.hook(b'prelock', throw=True) l = self._lock( vfs=self.svfs, lockname=b"lock", @@ -3146,6 +3147,7 @@ l.lock() return l + self.hook(b'prewlock', throw=True) # We do not need to check for non-waiting lock acquisition. Such # acquisition would not cause dead-lock as they would just fail. if wait and (