Show More
@@ -1007,8 +1007,7 b' class localrepository(object):' | |||||
1007 | def transaction(self, desc, report=None): |
|
1007 | def transaction(self, desc, report=None): | |
1008 | if (self.ui.configbool('devel', 'all-warnings') |
|
1008 | if (self.ui.configbool('devel', 'all-warnings') | |
1009 | or self.ui.configbool('devel', 'check-locks')): |
|
1009 | or self.ui.configbool('devel', 'check-locks')): | |
1010 | l = self._lockref and self._lockref() |
|
1010 | if self._currentlock(self._lockref) is None: | |
1011 | if l is None or not l.held: |
|
|||
1012 | raise RuntimeError('programming error: transaction requires ' |
|
1011 | raise RuntimeError('programming error: transaction requires ' | |
1013 | 'locking') |
|
1012 | 'locking') | |
1014 | tr = self.currenttransaction() |
|
1013 | tr = self.currenttransaction() | |
@@ -1320,8 +1319,8 b' class localrepository(object):' | |||||
1320 |
|
1319 | |||
1321 | If both 'lock' and 'wlock' must be acquired, ensure you always acquires |
|
1320 | If both 'lock' and 'wlock' must be acquired, ensure you always acquires | |
1322 | 'wlock' first to avoid a dead-lock hazard.''' |
|
1321 | 'wlock' first to avoid a dead-lock hazard.''' | |
1323 |
l = self._ |
|
1322 | l = self._currentlock(self._lockref) | |
1324 |
if l is not None |
|
1323 | if l is not None: | |
1325 | l.lock() |
|
1324 | l.lock() | |
1326 | return l |
|
1325 | return l | |
1327 |
|
1326 | |||
@@ -1352,8 +1351,7 b' class localrepository(object):' | |||||
1352 | # acquisition would not cause dead-lock as they would just fail. |
|
1351 | # acquisition would not cause dead-lock as they would just fail. | |
1353 | if wait and (self.ui.configbool('devel', 'all-warnings') |
|
1352 | if wait and (self.ui.configbool('devel', 'all-warnings') | |
1354 | or self.ui.configbool('devel', 'check-locks')): |
|
1353 | or self.ui.configbool('devel', 'check-locks')): | |
1355 | l = self._lockref and self._lockref() |
|
1354 | if self._currentlock(self._lockref) is not None: | |
1356 | if l is not None and l.held: |
|
|||
1357 | self.ui.develwarn('"wlock" acquired after "lock"') |
|
1355 | self.ui.develwarn('"wlock" acquired after "lock"') | |
1358 |
|
1356 | |||
1359 | def unlock(): |
|
1357 | def unlock(): |
General Comments 0
You need to be logged in to leave comments.
Login now