equal
deleted
inserted
replaced
3113 l = self._currentlock(self._lockref) |
3113 l = self._currentlock(self._lockref) |
3114 if l is not None: |
3114 if l is not None: |
3115 l.lock() |
3115 l.lock() |
3116 return l |
3116 return l |
3117 |
3117 |
|
3118 self.hook(b'prelock', throw=True) |
3118 l = self._lock( |
3119 l = self._lock( |
3119 vfs=self.svfs, |
3120 vfs=self.svfs, |
3120 lockname=b"lock", |
3121 lockname=b"lock", |
3121 wait=wait, |
3122 wait=wait, |
3122 releasefn=None, |
3123 releasefn=None, |
3137 l = self._wlockref() if self._wlockref else None |
3138 l = self._wlockref() if self._wlockref else None |
3138 if l is not None and l.held: |
3139 if l is not None and l.held: |
3139 l.lock() |
3140 l.lock() |
3140 return l |
3141 return l |
3141 |
3142 |
|
3143 self.hook(b'prewlock', throw=True) |
3142 # We do not need to check for non-waiting lock acquisition. Such |
3144 # We do not need to check for non-waiting lock acquisition. Such |
3143 # acquisition would not cause dead-lock as they would just fail. |
3145 # acquisition would not cause dead-lock as they would just fail. |
3144 if wait and ( |
3146 if wait and ( |
3145 self.ui.configbool(b'devel', b'all-warnings') |
3147 self.ui.configbool(b'devel', b'all-warnings') |
3146 or self.ui.configbool(b'devel', b'check-locks') |
3148 or self.ui.configbool(b'devel', b'check-locks') |