comparison mercurial/localrepo.py @ 35209:9153871d50e0

lock: allow to configure when the lock messages are displayed We add a new 'ui.timeout.warn' config to set a grace period before we display lock related warning: waiting for lock on PATH held by PROCESS The config is based on 'ui.timeout' and expresses a number of seconds before the warning is displayed. Negative values disable the warning altogether. The messages go to the debug output to help people trouble-shooting deadlocks.
author Boris Feld <boris.feld@octobus.net>
date Wed, 29 Nov 2017 20:39:59 -0500
parents 1b758105b5c7
children 9ce4e01f58ee
comparison
equal deleted inserted replaced
35208:1b758105b5c7 35209:9153871d50e0
1592 # determine whether it can be inherited 1592 # determine whether it can be inherited
1593 if parentenvvar is not None: 1593 if parentenvvar is not None:
1594 parentlock = encoding.environ.get(parentenvvar) 1594 parentlock = encoding.environ.get(parentenvvar)
1595 1595
1596 timeout = 0 1596 timeout = 0
1597 warntimeout = 0
1597 if wait: 1598 if wait:
1598 timeout = self.ui.configint("ui", "timeout") 1599 timeout = self.ui.configint("ui", "timeout")
1599 1600 warntimeout = self.ui.configint("ui", "timeout.warn")
1600 l = lockmod.trylock(self.ui, vfs, lockname, timeout, 1601
1602 l = lockmod.trylock(self.ui, vfs, lockname, timeout, warntimeout,
1601 releasefn=releasefn, 1603 releasefn=releasefn,
1602 acquirefn=acquirefn, desc=desc, 1604 acquirefn=acquirefn, desc=desc,
1603 inheritchecker=inheritchecker, 1605 inheritchecker=inheritchecker,
1604 parentlock=parentlock) 1606 parentlock=parentlock)
1605 return l 1607 return l