# HG changeset patch # User Siddharth Agarwal # Date 1443135431 25200 # Node ID 927fa07a2ba40764072043689ba53392c6832537 # Parent f51713b8c6fa33919b14f25ee73d030915dbf480 lock: introduce state to keep track of inheritance This is part of a series that will allow locks to be inherited by subprocesses in limited circumstances. In upcoming patches we will refer to this state. diff -r f51713b8c6fa -r 927fa07a2ba4 mercurial/lock.py --- a/mercurial/lock.py Thu Sep 24 10:53:16 2015 -0700 +++ b/mercurial/lock.py Thu Sep 24 15:57:11 2015 -0700 @@ -39,7 +39,7 @@ _host = None def __init__(self, vfs, file, timeout=-1, releasefn=None, acquirefn=None, - desc=None): + desc=None, parentlock=None): self.vfs = vfs self.f = file self.held = 0 @@ -47,6 +47,9 @@ self.releasefn = releasefn self.acquirefn = acquirefn self.desc = desc + self.parentlock = parentlock + self._parentheld = False + self._inherited = False self.postrelease = [] self.pid = os.getpid() self.delay = self.lock()