Show More
@@ -1127,6 +1127,9 b" coreconfigitem('ui', 'report_untrusted'," | |||
|
1127 | 1127 | coreconfigitem('ui', 'rollback', |
|
1128 | 1128 | default=True, |
|
1129 | 1129 | ) |
|
1130 | coreconfigitem('ui', 'signal-safe-lock', | |
|
1131 | default=True, | |
|
1132 | ) | |
|
1130 | 1133 | coreconfigitem('ui', 'slash', |
|
1131 | 1134 | default=False, |
|
1132 | 1135 | ) |
@@ -1693,12 +1693,15 b' class localrepository(object):' | |||
|
1693 | 1693 | if wait: |
|
1694 | 1694 | timeout = self.ui.configint("ui", "timeout") |
|
1695 | 1695 | warntimeout = self.ui.configint("ui", "timeout.warn") |
|
1696 | # internal config: ui.signal-safe-lock | |
|
1697 | signalsafe = self.ui.configbool('ui', 'signal-safe-lock') | |
|
1696 | 1698 | |
|
1697 | 1699 | l = lockmod.trylock(self.ui, vfs, lockname, timeout, warntimeout, |
|
1698 | 1700 | releasefn=releasefn, |
|
1699 | 1701 | acquirefn=acquirefn, desc=desc, |
|
1700 | 1702 | inheritchecker=inheritchecker, |
|
1701 |
parentlock=parentlock |
|
|
1703 | parentlock=parentlock, | |
|
1704 | signalsafe=signalsafe) | |
|
1702 | 1705 | return l |
|
1703 | 1706 | |
|
1704 | 1707 | def _afterlock(self, callback): |
@@ -21,6 +21,7 b' from . import (' | |||
|
21 | 21 | encoding, |
|
22 | 22 | error, |
|
23 | 23 | pycompat, |
|
24 | util, | |
|
24 | 25 | ) |
|
25 | 26 | |
|
26 | 27 | from .utils import ( |
@@ -177,7 +178,7 b' class lock(object):' | |||
|
177 | 178 | |
|
178 | 179 | def __init__(self, vfs, fname, timeout=-1, releasefn=None, acquirefn=None, |
|
179 | 180 | desc=None, inheritchecker=None, parentlock=None, |
|
180 | dolock=True): | |
|
181 | signalsafe=True, dolock=True): | |
|
181 | 182 | self.vfs = vfs |
|
182 | 183 | self.f = fname |
|
183 | 184 | self.held = 0 |
@@ -189,6 +190,10 b' class lock(object):' | |||
|
189 | 190 | self.parentlock = parentlock |
|
190 | 191 | self._parentheld = False |
|
191 | 192 | self._inherited = False |
|
193 | if signalsafe: | |
|
194 | self._maybedelayedinterrupt = _delayedinterrupt | |
|
195 | else: | |
|
196 | self._maybedelayedinterrupt = util.nullcontextmanager | |
|
192 | 197 | self.postrelease = [] |
|
193 | 198 | self.pid = self._getpid() |
|
194 | 199 | if dolock: |
@@ -244,7 +249,7 b' class lock(object):' | |||
|
244 | 249 | while not self.held and retry: |
|
245 | 250 | retry -= 1 |
|
246 | 251 | try: |
|
247 | with _delayedinterrupt(): | |
|
252 | with self._maybedelayedinterrupt(): | |
|
248 | 253 | self.vfs.makelock(lockname, self.f) |
|
249 | 254 | self.held = 1 |
|
250 | 255 | except (OSError, IOError) as why: |
General Comments 0
You need to be logged in to leave comments.
Login now