##// END OF EJS Templates
transaction: turn lack of locking into a hard failure (API)...
Pierre-Yves David -
r29186:e0fc0ed4 default
parent child Browse files
Show More
@@ -1000,7 +1000,8 b' class localrepository(object):'
1000 or self.ui.configbool('devel', 'check-locks')):
1000 or self.ui.configbool('devel', 'check-locks')):
1001 l = self._lockref and self._lockref()
1001 l = self._lockref and self._lockref()
1002 if l is None or not l.held:
1002 if l is None or not l.held:
1003 self.ui.develwarn('transaction with no lock')
1003 raise RuntimeError('programming error: transaction requires '
1004 'locking')
1004 tr = self.currenttransaction()
1005 tr = self.currenttransaction()
1005 if tr is not None:
1006 if tr is not None:
1006 return tr.nest()
1007 return tr.nest()
@@ -159,7 +159,15 b''
159
159
160 Test programming error failure:
160 Test programming error failure:
161
161
162 $ hg buggytransaction
162 $ hg buggytransaction 2>&1 | egrep -v '^ '
163 devel-warn: transaction with no lock at: $TESTTMP/buggylocking.py:* (buggylocking) (glob)
163 ** Unknown exception encountered with possibly-broken third-party extension buggylocking
164 ** which supports versions unknown of Mercurial.
165 ** Please disable buggylocking and try your action again.
166 ** If that fixes the bug please report it to the extension author.
167 ** Python * (glob)
168 ** Mercurial Distributed SCM (*) (glob)
169 ** Extensions loaded: * (glob)
170 Traceback (most recent call last):
171 RuntimeError: programming error: transaction requires locking
164
172
165 $ cd ..
173 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now